Esempio n. 1
0
 protected override void Dispose(bool disposing)
 {
     try                         // Save the Window state to the settings XML file (if the XML file exists and is valid).
     {
         DSSettings dsSettings = new DSSettings();
         dsSettings.ReadXml("QESettings.xml");
         dsSettings.settings [0].MdiParentMaximized = (WindowState == FormWindowState.Maximized);
         dsSettings.WriteXml("QESettings.xml");
     }
     catch (Exception) {}
     if (disposing)
     {
         if (components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose(disposing);
 }
Esempio n. 2
0
        public MainForm()
        {
            System.Threading.Thread.CurrentThread.Name = "Main Thread";                         // to ease debugging
            InitializeComponent();
            // Maximize main window if it was maximized last time...
            try
            {
                DSSettings dsSettings = new DSSettings();
                dsSettings.ReadXml("QESettings.xml");
                // Don't worry if no file / record is present for now - ConnectForm will create one for next time.
                if (dsSettings.settings [0].MdiParentMaximized)
                {
                    WindowState = FormWindowState.Maximized;
                }
            }
            catch (Exception) {}

            // Wire the toolbar buttons to the event handlers already defined for the menu options.
            // Assign the event handlers to the tag property, which can query when toolbar's click event is handled.

            tbConnect.Tag    = new EventHandler(miConnect_Click);
            tbDisconnect.Tag = new EventHandler(miDisconnect_Click);

            tbNew.Tag  = new EventHandler(miNew_Click);
            tbOpen.Tag = new EventHandler(miOpen_Click);
            tbSave.Tag = new EventHandler(miSave_Click);

            tbExecute.Tag = new EventHandler(miExecute_Click);
            tbCancel.Tag  = new EventHandler(miCancel_Click);

            tbHideBrowser.Tag = new EventHandler(miHideBrowser_Click);
            tbHideResults.Tag = new EventHandler(miHideResults_Click);

            tbResultsGrid.Tag = new EventHandler(miResultsGrid_Click);
            tbResultsText.Tag = new EventHandler(miResultsText_Click);

            // Start by displaying the Connection dialog
            miConnect.PerformClick();
        }