示例#1
0
        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();
        }
示例#2
0
        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();
            }
        }
示例#3
0
 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();
     }
 }