} //end menu_Options_Click private void ShowOptions() { FormProperties opt = new FormProperties(m_Options); opt.OnPropertyChangedAction = (propertyName) => { ReApplyOptions(); }; opt.ShowDialog(this); opt.Dispose(); if (m_Options.Interface == "") { Utils.MessageBox("Please select a valid Network interface"); ShowOptions(); } //end if else { OptionsSerializer.Save(m_sSettingsFile, m_Options); GenericSerializer.SaveAs <Options>(m_Options, m_sSettingsFile + ".xml"); ReApplyOptions(); } //end else } //end ShowOptions
} //end menu_Exit_Click private void AppExit(object sender, EventArgs e) { m_OleDbConnection.Close(); OptionsSerializer.Save(m_sSettingsFile, m_Options); } //end AppExit
} //end Constructor private void FormLoadGraph_Load(object sender, System.EventArgs e) { try { OptionsSerializer.Load(m_sSettingsFile, m_Options); if (m_Options.Location.X > 0 || m_Options.Location.Y > 0) { this.Size = m_Options.Size; this.Location = m_Options.Location; } //end if else { this.CenterToScreen(); } _screenSaver = new ScreenSaver(this); ReApplyOptions(); ShowWindowBorder(m_Options.ShowWindowBorder); } //end try catch (System.IO.FileNotFoundException) { ShowOptions(); } //end catch catch (Exception err) { string msg = err.Message; while (err.InnerException != null) { err = err.InnerException; msg = err.Message; } Utils.MessageBox("Load error: " + msg); Close(); } finally { m_SendIPEmail = new SendEmail(m_Options); m_Timer.Start(); _workingThreadCounters = new Thread(st => { while (!_close) { LogData(); if (!_close) { Thread.Sleep(1000); } } }); _stopper.Start(); _workingThreadCounters.IsBackground = true; _workingThreadCounters.Start(); //ICollection thds = Process.GetCurrentProcess().Threads; //foreach (ProcessThread pt in thds) // pt.PriorityLevel = ThreadPriorityLevel.BelowNormal; } //end finally } //end FormLoadGraph_Load