示例#1
0
        public MainForm()
        {
            InitializeComponent();

            ServicePointManager.SecurityProtocol = Tls12;

            if (Properties.Settings.Default.NeedUpgrade)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.NeedUpgrade           = false;
                Properties.Settings.Default.AutoUpdateThisVersion = true;
                Properties.Settings.Default.Save();
            }

            if (Program.Mono)
            {
                comboBoxUserColor1.BackColor = Color.DarkGreen;
                comboBoxUserColor1.ForeColor = Color.White;
                comboBoxUserColor2.BackColor = Color.DarkBlue;
                comboBoxUserColor2.ForeColor = Color.White;
                comboBoxUserColor3.BackColor = Color.DarkRed;
                comboBoxUserColor3.ForeColor = Color.White;
                comboBoxUserColor4.BackColor = Color.DarkViolet;
                comboBoxUserColor4.ForeColor = Color.White;
                comboBoxUserColor5.BackColor = Color.DarkOrange;
                comboBoxUserColor5.ForeColor = Color.White;
                richTextBox1.Font            = new Font(richTextBox1.Font, FontStyle.Bold);
            }

            createProjectMenu();

            #region loadSettings
            loadSelectedProject();
            #endregion

            #region initialization of background workers
            bwSuggestions.DoWork += new DoWorkEventHandler(bwSuggestions_DoWork);
            bwSuggestions.WorkerSupportsCancellation = true;

            bwLoadHistory.DoWork += new DoWorkEventHandler(bwLoadHistory_DoWork);
            bwLoadHistory.WorkerSupportsCancellation = true;

            bwFindRevision.DoWork += new DoWorkEventHandler(bwFindRevision_DoWork);
            bwFindRevision.WorkerSupportsCancellation = true;

            bwAuthors.DoWork += new DoWorkEventHandler(bwAuthors_DoWork);
            bwAuthors.WorkerSupportsCancellation = true;
            #endregion

            articleSuggestions.Left  = textBoxArticleTitle.Left + groupBox1.Left;
            articleSuggestions.Width = textBoxArticleTitle.Width;
            articleSuggestions.Top   = textBoxArticleTitle.Top + groupBox1.Top + textBoxArticleTitle.Height;

            listViewEdits.ListViewItemSorter = lvwColumnSorterEdits;
            listViewUsers.ListViewItemSorter = lvwColumnSorterUsers;

            suggestionFetcher = new SuggestionFetcher(Projects.currentProjectBaseUrl, 30);
            revisionsFetcher  = new RevisionsFetcher(Projects.currentProjectBaseUrl);

            comboBox1.SelectedIndex = 0;

            prepareListViewStatistics();

            if ((Properties.Settings.Default.AutoUpdate) && (Properties.Settings.Default.AutoUpdateThisVersion))
            {
                AutoUpdate.CheckForUpdate();
            }
        }
示例#2
0
 private void menuHelpCheckUpdates_Click(object sender, EventArgs e)
 {
     AutoUpdate.CheckForUpdateBlocking();
 }