Example #1
0
        private void onSetupWizardClicked(object sender, EventArgs e)
        {
            frmSetup frm = new frmSetup();

            frm.OnSetupFinished += setupCompleted;
            frm.Show();
        }
Example #2
0
        /// <summary>
        /// Gets this whole application rolling
        /// </summary>
        public MainContext()
        {
            setupIcon();

            if (!Properties.Settings.Default.is_setup)
            {
                first_time = true; //To cache this - it's changed in the Setup form.
                frmSetup frm = new frmSetup();
                frm.OnSetupFinished += setupCompleted;
                frm.Show();
            }

            //Load registry value
            RegistryKey rk = Registry.CurrentUser.OpenSubKey(RegistryPath, true);

            isRunningOnLogin = (rk.GetValue(KeyName) != null);

            // Don't automatically start unless user wants to
            if (Properties.Settings.Default.StartOnLogin && !isRunningOnLogin)
            {
                rk.SetValue(KeyName, Application.ExecutablePath);
            }
            else if (!Properties.Settings.Default.StartOnLogin && isRunningOnLogin)
            {
                rk.DeleteValue(KeyName, false);
            }

            try {
                GlobalVariables.Units = JsonConvert.DeserializeObject <List <Unit> >(Properties.Settings.Default.UnitData);
                if (GlobalVariables.Units == null)
                {
                    GlobalVariables.Units = new List <Unit>();
                }
                //Debugging
                //else {
                //    foreach (Unit u in GlobalVariables.Units) {
                //        Console.WriteLine(u.Name);
                //        foreach (BlackboardFile f in u.Files) {
                //            Console.WriteLine(f.RawURL);
                //        }
                //    }
                //}
            } catch {
                GlobalVariables.Units = new List <Unit>();
            }

            crawler.OnSyncCompleted       += Crawler_OnSyncCompleted;
            crawler.OnLoginProblem        += Crawler_OnLoginProblem;
            crawler.OnLoginSuccess        += Crawler_OnLoginSuccess;
            crawler.OnConnectivityProblem += Crawler_OnConnectivityProblem;
            crawler.OnCrawlingEvent       += Crawler_OnCrawlingEvent;

            tm_refresh.Tick += tm_refresh_Tick;
            tm_refresh_Tick(tm_refresh, new EventArgs()); //Fire the first event
            tm_refresh.Start();
        }
Example #3
0
        /// <summary>
        /// Gets this whole application rolling
        /// </summary>
        public MainContext()
        {
            setupIcon();

            if (!Properties.Settings.Default.is_setup) {
                first_time = true; //To cache this - it's changed in the Setup form.
                frmSetup frm = new frmSetup();
                frm.OnSetupFinished += setupCompleted;
                frm.Show();
            }

            //Load registry value
            RegistryKey rk = Registry.CurrentUser.OpenSubKey(RegistryPath, true);
            isRunningOnLogin = (rk.GetValue(KeyName) != null);
            if (!isRunningOnLogin)
                rk.SetValue(KeyName, Application.ExecutablePath);

            try {
                GlobalVariables.Units = JsonConvert.DeserializeObject<List<Unit>>(Properties.Settings.Default.UnitData);
                if (GlobalVariables.Units == null)
                    GlobalVariables.Units = new List<Unit>();
                //Debugging
                //else {
                //    foreach (Unit u in GlobalVariables.Units) {
                //        Console.WriteLine(u.Name);
                //        foreach (BlackboardFile f in u.Files) {
                //            Console.WriteLine(f.RawURL);
                //        }
                //    }
                //}
            } catch {
                GlobalVariables.Units = new List<Unit>();
            }

            crawler.OnSyncCompleted += Crawler_OnSyncCompleted;
            crawler.OnLoginProblem += Crawler_OnLoginProblem;
            crawler.OnLoginSuccess += Crawler_OnLoginSuccess;
            crawler.OnConnectivityProblem += Crawler_OnConnectivityProblem;
            crawler.OnCrawlingEvent += Crawler_OnCrawlingEvent;

            tm_refresh.Tick += tm_refresh_Tick;
            tm_refresh_Tick(tm_refresh, new EventArgs()); //Fire the first event
            tm_refresh.Start();
        }
Example #4
0
 private void onSetupWizardClicked(object sender, EventArgs e)
 {
     frmSetup frm = new frmSetup();
     frm.OnSetupFinished += setupCompleted;
     frm.Show();
 }