예제 #1
0
        private void btnEditProfile_Click(object sender, EventArgs e)
        {
            // edit the selected profile
            DeploymentProfile profile = SelectedProfile;
            string            oldName = profile.Name;

            FrmConnSettings frmConnSettings = new FrmConnSettings()
            {
                Profile = profile,
                ExistingProfileNames = deploymentSettings.GetExistingProfileNames(oldName)
            };

            if (frmConnSettings.ShowDialog() == DialogResult.OK)
            {
                // update the profile name if it changed
                if (oldName != profile.Name)
                {
                    deploymentSettings.Profiles.Remove(oldName);

                    try
                    {
                        cbProfile.BeginUpdate();
                        cbProfile.Items.RemoveAt(cbProfile.SelectedIndex);
                        AddProfileToLists(profile);
                    }
                    finally
                    {
                        cbProfile.EndUpdate();
                    }
                }

                // save the deployment settings
                SaveDeploymentSettings();
            }
        }
예제 #2
0
        private void btnCreateProfile_Click(object sender, EventArgs e)
        {
            // create a new profile
            DeploymentProfile profile = new DeploymentProfile();

            FrmConnSettings frmConnSettings = new FrmConnSettings()
            {
                Profile = profile,
                ExistingProfileNames = deploymentSettings.GetExistingProfileNames()
            };

            if (frmConnSettings.ShowDialog() == DialogResult.OK)
            {
                AddProfileToLists(profile);
                SaveDeploymentSettings();
            }
        }