private void EditBtn_Click(object sender, EventArgs e) { if (InitialisationView.SelectedItems.Count == 1) { ListViewItem li = InitialisationView.SelectedItems[0]; GXDLMSModemConfiguration target = Target as GXDLMSModemConfiguration; GXDLMSModemInitialisation item = InitialisationView.SelectedItems[0].Tag as GXDLMSModemInitialisation; GXDLMSModemConfigurationDlg dlg = new GXDLMSModemConfigurationDlg(item); if (dlg.ShowDialog(this) == DialogResult.OK) { UpdateModemInitialisationUI(item, li); errorProvider1.SetError(InitialisationView, Properties.Resources.ValueChangedTxt); target.UpdateDirty(3, target.InitialisationStrings); } } }
private void AddBtn_Click(object sender, EventArgs e) { GXDLMSModemConfiguration target = Target as GXDLMSModemConfiguration; GXDLMSModemInitialisation item = new GXDLMSModemInitialisation(); GXDLMSModemConfigurationDlg dlg = new GXDLMSModemConfigurationDlg(item); if (dlg.ShowDialog(this) == DialogResult.OK) { List <GXDLMSModemInitialisation> list = new List <GXDLMSModemInitialisation>(); if (target.InitialisationStrings != null) { list.AddRange(target.InitialisationStrings); } list.Add(item); target.InitialisationStrings = list.ToArray(); UpdateModemInitialisationUI(item, null); errorProvider1.SetError(InitialisationView, Properties.Resources.ValueChangedTxt); target.UpdateDirty(3, target.InitialisationStrings); } }