Exemple #1
0
 private void buttonOptions_Click(object sender, EventArgs e)
 {
     try
     {
         FormOptions dialog = new FormOptions();
         if (DialogResult.OK == dialog.ShowDialog(this))
         {
             ApplyConfiguration();
         }
     }
     catch (Exception exception)
     {
         FormError.Show(this, null, exception.Message, exception);
     }
 }
Exemple #2
0
        private void FormBase_FormClosed(object sender, FormClosedEventArgs e)
        {
            foreach (ITutorial item in _listTutorials)
            {
                try
                {
                    item.Disconnect();
                }
                catch (Exception exception)
                {
                    Console.WriteLine("ITutorial Disconnect Exception:" + exception.Message);
                }
            }

            FormOptions.SaveConfigurationToXMLFile();
        }
Exemple #3
0
 /// <summary>
 /// Load config file or display options dialog if config file not exists
 /// </summary>
 /// <param name="owner">modal owner for dialog</param>
 public static void LoadConfigurationFromXMLFile(IWin32Window owner)
 {
     if (File.Exists(_fullConfigFilePath))
     {
         XmlDocument configDocument = new XmlDocument();
         configDocument.Load(_fullConfigFilePath);
         _lcid = Convert.ToInt32(configDocument.FirstChild.ChildNodes[0].InnerText);
         _connectToDocumentation = Convert.ToBoolean(configDocument.FirstChild.ChildNodes[1].InnerText);
         _saveSettings           = Convert.ToBoolean(configDocument.FirstChild.ChildNodes[2].InnerText);
     }
     else
     {
         FormOptions dialog = new FormOptions();
         dialog.ShowDialog(owner);
     }
 }
Exemple #4
0
 public static void LoadConfigurationFromXMLFile(IWin32Window owner)
 {
     if (File.Exists(_fullConfigFilePath))
     {
         XmlDocument configDocument = new XmlDocument();
         configDocument.Load(_fullConfigFilePath);
         _lcid = Convert.ToInt32(configDocument.FirstChild.ChildNodes[0].InnerText);
         _connectToDocumentation = Convert.ToBoolean(configDocument.FirstChild.ChildNodes[1].InnerText);
         _saveSettings = Convert.ToBoolean(configDocument.FirstChild.ChildNodes[2].InnerText);
     }
     else
     { 
         FormOptions dialog = new FormOptions();
         dialog.ShowDialog(owner);
     }
 }
Exemple #5
0
 public FormBase()
 {
     InitializeComponent();
     FormOptions.LoadConfigurationFromXMLFile(this);
     ApplyConfiguration();
 }
Exemple #6
0
 private void buttonOptions_Click(object sender, EventArgs e)
 {
     try
     {
         FormOptions dialog = new FormOptions();
         if (DialogResult.OK == dialog.ShowDialog(this))
             ApplyConfiguration();
     }
     catch(Exception exception)
     {
         FormError.Show(this, null, exception.Message, exception);  
     }
 }