Esempio n. 1
0
 /// <summary>
 /// Makes settings window visible.
 /// </summary>
 private void ShowSettingsWindow()
 {
     try
     {
         if (SettingsWindow == null)
         {
             SettingsWindow = new FormSettings(this);
         }
         SettingsWindow.SetComboThemeText(CurrentTheme.Substring(0, 1).ToUpper() + CurrentTheme.Substring(1) + " theme");
         SettingsWindow.SetCompilerPath(CompilerPath);
         SettingsWindow.Show();
         SettingsWindow.Activate();
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Unexpected error happened while trying to open setting window. {ex.Message}");
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Initialises main form. Also increment counter for additional forms created not to load previous state.
        /// </summary>
        public FormMain()
        {
            InitializeComponent();

            if (FormCounter == 0)
            {
                LoadPrevFormState();
            }
            FormNumber = FormCounter;
            try
            {
                SettingsWindow = new FormSettings(this);
                if (FormCounter == 0)
                {
                    MessageBox.Show($"Backup files could be found in notapadData/backups. {Environment.NewLine}" +
                                    $"Loaded settings for autosave and autobackup will not be displayed in settings window, but they will be loaded, if loading file is correct.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Error. {ex.Message}");
            }
            FormCounter++;
        }