Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (ConnectionStringMode)
            {
                if (!String.IsNullOrEmpty(_settingName) && _settingName != txtName.Text)
                {
                    // they changed the name.  Remove the old one from the document before adding the new one.
                    this.AdminProxy.DeleteConnectionString(_settingName, _configFilePath);
                }

                this.AdminProxy.SaveConnectionString(txtName.Text, txtValue.Text, ddlProvider.Text, _configFilePath);
            }
            else
            {
                if (!String.IsNullOrEmpty(_settingName) && _settingName != txtName.Text)
                {
                    // they changed the name.  Remove the old one from the document before adding the new one.
                    AdminProxy.DeleteApplicationSetting(_settingName, _configFilePath);
                }

                AdminProxy.SaveApplicationSetting(txtName.Text, txtValue.Text, _configFilePath);
            }

            DialogResult = DialogResult.OK;
            if (!Modal)
            {
                MainFormSelectParentTreeNode();
            }
            else
            {
                Close();
            }
        }
Ejemplo n.º 2
0
 private void promptToDeleteAppSettings()
 {
     if (lv.SelectedItems.Count > 0)
     {
         if (DialogResult.Yes == MessageBox.Show(this, getDisplayMember("promptToDeleteAppSettings{start_body}", "Are you sure you want to delete application setting(s)?"),
                                                 getDisplayMember("promptToDeleteAppSettings{start_title}", "Delete Application Setting(s)?"), MessageBoxButtons.YesNo, MessageBoxIcon.Question))
         {
             foreach (ListViewItem lvi in lv.SelectedItems)
             {
                 AdminProxy.DeleteApplicationSetting(lvi.Tag.ToString(), _configFilePath);
             }
             MainFormUpdateStatus(getDisplayMember("promptToDeleteAppSettings{done}", "Deleted {0} Application Settings", lv.SelectedItems.Count.ToString("###,##0")), true);
             RefreshData();
         }
     }
 }