Esempio n. 1
0
 //Before loading of application form we read and parse settings
 private void SealedNotes_Load(object sender, EventArgs e)
 {
     //Read preferences
     ActualSettings = new Settings();
     if (ActualPreferences.InfoRead() == true)
     {
         _isSettingsError = false;
         if (ActualPreferences.AskPassword == true)
         {
             frmAskPassword ap = new frmAskPassword();
             ap.Password = ActualPreferences.Password;
             ap.ShowDialog();
             FileReader();
         }
         else
         {
             FileReader(); //Read notes
         }
     }
     else
     {
         FileInfo fi = new FileInfo(GetPathToStorage());
         if (fi.Exists == true)
         {
             MessageBox.Show("Can't read settings file! To open data, please select right preferences and restart application!");
             _isSettingsError = true;
             ActualPreferences.AskPassword = false;
         }
     }
 }
Esempio n. 2
0
 //Before loading of application form we read and parse settings
 private void SealedNotes_Load(object sender, EventArgs e)
 {
     //Read preferences
     ActualSettings = new Settings();
     if (ActualPreferences.InfoRead() == true)
     {
         _isSettingsError = false;
         if (ActualPreferences.AskPassword == true)
         {
             frmAskPassword ap = new frmAskPassword();
             ap.Password = ActualPreferences.Password;
             ap.ShowDialog();
             FileReader();
         }
         else
         {
             FileReader(); //Read notes
         }
     }
     else
     {
         FileInfo fi = new FileInfo(GetPathToStorage());
         if (fi.Exists == true)
         {
             MessageBox.Show("Can't read settings file! To open data, please select right preferences and restart application!");
             _isSettingsError = true;
             ActualPreferences.AskPassword = false;
         }
     }
 }