private void listBox_SelectedIndexChanged(object sender, EventArgs e) { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); if (listBox.SelectedIndex == -1) { System.ComponentModel.ComponentResourceManager localResources = new System.ComponentModel.ComponentResourceManager(typeof(ADPermissionsForm)); btnAddSave.Text = localResources.GetString("btnAddSave.Text"); txtCmd.Text = ""; return; } btnAddSave.Text = PackageEditor.Messages.Messages.btnApply; ADEntity entity = curEntities[listBox.SelectedIndex]; txtCmd.Text = entity.name; }
private void PropertyToADEntities(String inPropertyName, List <ADEntity> outEntities) { String inPropertyValue = ""; virtPackage.GetProperty(inPropertyName, ref inPropertyValue); String[] values = inPropertyValue.Split(';'); foreach (String value in values) { if (value == "") { continue; } var newEntity = new ADEntity(value); outEntities.Add(newEntity); } }
private void btnAddSave_Click(object sender, EventArgs e) { int saveSelectedIndex = listBox.SelectedIndex; System.ComponentModel.ComponentResourceManager localResources = new System.ComponentModel.ComponentResourceManager(typeof(CustomEventsForm)); if (txtCmd.Text.Trim() == "") { MessageBox.Show("Please enter a valid name"); return; } int selectedIndex = listBox.SelectedIndex; if (listBox.SelectedIndex == -1) { curEntities.Add(new ADEntity(txtCmd.Text)); } else { ADEntity entity = curEntities[listBox.SelectedIndex]; entity.name = txtCmd.Text; } RefreshDisplay(); //listBox.SelectedIndex = -1; // Force refresh }
private void PropertyToADEntities(String inPropertyName, List<ADEntity> outEntities) { String inPropertyValue = ""; virtPackage.GetProperty(inPropertyName, ref inPropertyValue); String[] values = inPropertyValue.Split(';'); foreach (String value in values) { if (value == "") continue; var newEntity = new ADEntity(value); outEntities.Add(newEntity); } }