private void BtnNewClick(object sender, EventArgs e) { var dlg = new InputText { Title = "Enter Profile Name", TextLabel = "Profile Name" }; if (dlg.ShowDialog() == DialogResult.OK) { if (!IsValidName(dlg.TextValue)) { MessageBox.Show(Properties.Resources.Profile_name_should_be_unique_Error_Text, Properties.Resources.Error_Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } SaveSelectedServices(); _selectedProfile = new Profile { Name = dlg.TextValue }; Properties.Settings.Default.Profiles.Add(_selectedProfile); PopulateListBoxes(); UpdateDropDown(); } }
private void BtnRenameClick(object sender, EventArgs e) { var dlg = new InputText { Title = "Enter New Profile Name", TextLabel = "Profile Name", TextValue = _selectedProfile.Name }; if (dlg.ShowDialog() == DialogResult.OK) { _selectedProfile.Name = dlg.TextValue; UpdateDropDown(); } }
private void BtnNewClick(object sender, EventArgs e) { var dlg = new InputText { Title = "Enter Profile Name", TextLabel = "Profile Name" }; if (dlg.ShowDialog() == DialogResult.OK) { if (!IsValidName(dlg.TextValue)) { MessageBox.Show(Properties.Resources.Profile_name_should_be_unique_Error_Text, Properties.Resources.Error_Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } SaveSelectedServices(); _selectedProfile = new Profile {Name = dlg.TextValue}; Properties.Settings.Default.Profiles.Add(_selectedProfile); PopulateListBoxes(); UpdateDropDown(); } }