コード例 #1
0
ファイル: SettingForm.cs プロジェクト: Voenkaff/Test
        private void SaveButton_Click(object sender, System.EventArgs e)
        {
            ConfigContainer.GetConfig <EditorConfig>().SaveFolder = SavePathTextBox.Text;
            ConfigContainer.SaveConfiguration();

            Close();

            MessageBox.Show(@"Сохранение настроек прошло успешно", @"Настройки сохранены", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #2
0
        private void SaveConfig()
        {
            var config = ConfigContainer.GetConfig <ServerConfig>();

            config.ResultFolder = ResultFolderTextBox.Text;
            config.TestFolder   = TestFolderTextBox.Text;

            config.ServerIp   = IpTextBox.Text;
            config.ServerPort = int.Parse(PortLabelTextBox.Text);

            ConfigContainer.SaveConfiguration();
            ListenerContainer.Restart();
        }
コード例 #3
0
ファイル: FormSettings.cs プロジェクト: Voenkaff/Test
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (!IsIpValid())
            {
                MessageBox.Show(@"Ип аддресс не правильный");
                return;
            }

            if (!IsPortValid())
            {
                MessageBox.Show(@"Порт должен быть числом от 0 до 65535");
                return;
            }

            _config.ServerIp   = IpAddressTextBox.Text;
            _config.ServerPort = int.Parse(PortTextBox.Text);

            ConfigContainer.SaveConfiguration();

            Close();
        }