コード例 #1
0
ファイル: SettingsForm.cs プロジェクト: Karabaev/Skat
        /// <summary>
        /// Нажатие на кнопку закрыть и сохранить.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CloseBtn_Click(object sender, EventArgs e)
        {
            try
            {
                SettingsContainer.SetSettings(new Settings
                {
                    FtpUri                   = FtpUriTxt.Text,
                    FtpIsPassive             = Convert.ToInt32(PassiveChk.Checked),
                    FtpDownloadInttervalSec  = int.Parse(IntervalTxt.Text),
                    FtpFolder                = WBFolderTxt.Text,
                    ServiceName              = ServiceNameTxt.Text,
                    FtpTimeoutSec            = int.Parse(FtpTimeoutTxt.Text),
                    ExchangeFolder           = ExchFolderTxt.Text,
                    DownloadExchangeFileName = DownFileNameTxt.Text,
                    UploadExchangeFileName   = UpFileNameTxt.Text
                });
            }
            catch (FormatException)
            {
                MessageBox.Show("The format of the argument is not valid.", "Error");
                return;
            }

            this.Close();
        }