ApplyRunOnStartup() static private method

static private ApplyRunOnStartup ( ) : void
return void
コード例 #1
0
        private void ButtonOk_Click(object eventSender, EventArgs eventArgs)
        {
            if (string.IsNullOrEmpty(this.TextFileNameFormat.Text))
            {
                Interaction.MsgBox("Please enter a value for the downloaded programme file name format.", MsgBoxStyle.Exclamation);
                this.TextFileNameFormat.Focus();
                this.cancelClose = true;
                return;
            }

            bool formatChanged = Settings.FileNameFormat != this.TextFileNameFormat.Text;

            if (this.folderChanged || formatChanged)
            {
                string message = "Move existing downloads to \"" + this.TextSaveIn.Text + "\" and rename to new naming format?";

                if (!formatChanged)
                {
                    message = "Move existing downloads to \"" + this.TextSaveIn.Text + "\"?";
                }
                else if (!this.folderChanged)
                {
                    message = "Rename existing downloads to new naming format?";
                }

                if (MessageBox.Show(message, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    using (Status status = new Status())
                    {
                        status.ShowDialog(
                            this,
                            delegate
                        {
                            Model.Download.UpdatePaths(status, this.TextSaveIn.Text, this.TextFileNameFormat.Text);
                        });
                    }
                }

                Settings.SaveFolder     = this.TextSaveIn.Text;
                Settings.FileNameFormat = this.TextFileNameFormat.Text;
            }

            Settings.RunOnStartup      = this.CheckRunOnStartup.Checked;
            Settings.RunAfterCommand   = this.TextRunAfter.Text;
            Settings.ParallelDownloads = (int)this.NumberParallel.Value;
            Settings.RssServer         = this.CheckRssServer.Checked;

            if (this.CheckRssServer.Checked)
            {
                Settings.RssServerPort         = (int)this.NumberServerPort.Value;
                Settings.RssServerNumRecentEps = (int)this.NumberEpisodes.Value;
            }

            if (OsUtils.WinSevenOrLater())
            {
                Settings.CloseToSystray = this.CheckCloseToSystray.Checked;
            }

            OsUtils.ApplyRunOnStartup();
        }
コード例 #2
0
        private void ButtonReset_Click(object sender, EventArgs e)
        {
            if (Interaction.MsgBox("Are you sure that you would like to reset all of your settings?", MsgBoxStyle.YesNo | MsgBoxStyle.Question) == MsgBoxResult.Yes)
            {
                Settings.ResetUserSettings();
                OsUtils.ApplyRunOnStartup();

                this.Close();
            }
        }