Exemple #1
0
        private void SettingsBT_Click(object sender, EventArgs e)
        {
            string currStore = StoreLocationCB.SelectedItem.ToString();

            SettingsViewFRM settings = new SettingsViewFRM();

            settings.ShowDialog();

            if (Settings_Changed)
            {
                Configuration.Helpers.Deserialize_Condensed(Properties.Settings.Default.ConfigPath);
                MainStatusSSL.Text = string.Empty;
                StoreLocationCB_Initialize();
                ReposLV_Initialize();
            }

            int index = StoreLocationCB.FindStringExact(currStore);

            if (index != -1)
            {
                StoreLocationCB.SelectedIndex = index;
            }

            else
            {
                StoreLocationCB.SelectedIndex = 0;
            }

            if (Properties.Settings.Default.AutoChangeRate != -1)
            {
                AutoCheckTMR.Interval = Properties.Settings.Default.AutoChangeRate * 1000;
                AutoCheckTMR.Enabled  = true;
                AutoCheckTMR.Start();
            }

            else
            {
                AutoCheckTMR.Stop();
                AutoCheckTMR.Interval = 0;
                AutoCheckTMR.Enabled  = false;
            }
        }
Exemple #2
0
        public MainViewFRM(string [] filepaths = null)
        {
            #region Registry Stuff - Not Used

            //RegistryKey fileAssoc = Registry.ClassesRoot.OpenSubKey(@".gmc", true);

            //if (fileAssoc != null)
            //{
            //    RegistryKey iconSet = fileAssoc.OpenSubKey("DefaultIcon", true);

            //    if (iconSet != null)
            //    {
            //        string val = (string)iconSet.GetValue("", string.Empty);

            //        if (val != string.Empty)
            //        {

            //        }

            //        else
            //        {
            //            iconSet.SetValue("", @"Z:\Software Engineering\GIT Management Config\FileIcon.ico");
            //        }
            //    }

            //    else
            //    {
            //        MessageBox.Show("No Icon Set");
            //        fileAssoc.CreateSubKey("DefaultIcon");
            //        iconSet = fileAssoc.OpenSubKey("DefaultIcon");
            //        iconSet.SetValue("(Default)", @"Z:\Software Engineering\Published Applications\GIT Manager\FileIcon.ico");
            //        iconSet.Close();
            //        fileAssoc.Close();
            //    }
            //}

            //else
            //{

            //}

            #endregion Registry Stuff - Not Used

            #region Arguments were empty (filepaths = null)

            if (filepaths == null)
            {
                Splash = new Thread(new ThreadStart(SplashStart));
                Splash.Start();

                while (!InitializationData.Initialized)
                {
                    Thread.Sleep(1000);

                    if (InitializationData.Abort)
                    {
                        Splash.Abort();

                        MessageBox.Show("Error loading configuration, closing GIT Manager.", "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                        Application.ExitThread();
                        Application.Exit();
                        Environment.Exit(1);
                    }
                }

                InitializeComponent();

                Splash.Abort();

                Refresh_Elements(false);

                //ReposLV.ShowItemToolTips = true;
                MainStatusSSL.Text = string.Empty;

                StoreLocationCB_Initialize();

                ReposLV_Initialize();

                this.BringToFront();

                if (Properties.Settings.Default.AutoChangeRate > 0)
                {
                    AutoCheckTMR.Interval = Properties.Settings.Default.AutoChangeRate * 1000;
                    AutoCheckTMR.Enabled  = true;
                    AutoCheckTMR.Start();
                }
            }

            #endregion

            #region Arguments Were Not Empty (filepaths)

            else
            {
            }

            #endregion
        }