Profile Picture

Loading without prompting to save

Posted By NeilTurp 7 Years Ago
Author
Message
NeilTurp
Problem Posted 7 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 6 Years Ago
Posts: 0, Visits: 166
I have a app, xamarin on OSX, it has a list of topics,  When the user selects a topic, the app searches a folder and loads the relevant file if there is one, and shows an empty text editor window if there is not.  The user can edit the file and when they move to another topic, it automatically saves - there is no time when the user is asked to find a file to load or to give a file a name to save.  The code is:

Nevron.Nov.Text.Formats.NTextFormat tf = new Nevron.Nov.text.Formats.NRtfTextFormat();
if (System.IO.File.Exists(<FileName read from list>Wink)
{
     tvKey.LoadFromFile(<Filename>, tf, false);
}
else {
    tvKey.LoadNewDocument(); 
}

      
It all works ok if there is a file there to start with, the problem occurs if there is no data file to read and the user types into the text window.  In this case, the file is saved, all code exits, perfect, and then it shows a dialog that asks the user to Save, Don't Save, Cancel.  I can't see what I've missed.  Any ideas?
Neil




Similar Topics


Reading This Topic