private int updatefrequency = 12; // in hours #endregion Fields #region Constructors public frmMain() { InitializeComponent(); lvwSystems.ListViewItemSorter = lvwSorter; this.Enabled = false; stat = new Interface.frmStartup(); stat.Show(); stat.Refresh(); }
private void frmMain_Shown(object sender, EventArgs e) { if (cont) { stat.SetStatus("Initializing, please wait..."); scnr.ScanComplete += scnr_ScanComplete; scnr.ScanCancelled += scnr_ScanCancelled; scnr.ScanUpdate += scnr_ScanUpdate; schedule.ItemUpdated += schedule_ItemUpdated; schedule.ScriptInvoked += schedule_ScriptInvoked; schedule.ScheduleRemoved += schedule_ScheduleRemoved; stat.SetStatus("Checking Settings, please wait..."); CheckSettings(); if (poshsecframework.Properties.Settings.Default.FirstTime) { restart = true; stat.Hide(); FirstTimeSetup(); } if (restart) { Application.Restart(); this.Close(); } else { Initialize(); stat.Show(); stat.SetStatus("Loading Networks, please wait..."); GetNetworks(); GetAlerts(); } if (loaderrors != "") { DisplayOutput(StringValue.ImportError + Environment.NewLine + loaderrors, null, false, false, false, true); } shown = true; stat.Close(); stat.Dispose(); stat = null; this.Enabled = true; this.Focus(); schedule.Start(); } else { this.Close(); } }
public frmMain() { InitializeComponent(); lvwSystems.ListViewItemSorter = lvwSorter; this.Enabled = false; if (IsRootDrive()) { cont = false; if (MessageBox.Show(StringValue.RootDrive, "Running in root drive!", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { cont = true; } } if (cont) { stat = new Interface.frmStartup(); stat.Show(); stat.Refresh(); } }