コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
 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();              
     }
 }