private void AddItem(ListBox lb, object item) { ValueColor itemEle = item as ValueColor; foreach (ValueColor element in lb.Items) { if (element.Value == itemEle.Value) { return; } } lb.Items.Add(itemEle.Copy()); }
private void C_BtnRemove_Click(object sender, System.EventArgs e) { ValueColorCollection InitValues = new ValueColorCollection(); InitValues.series = valuesColor.series; for (int i = 0; i < this.C_LBSelFields.Items.Count; i++) { ValueColor elet = this.C_LBSelFields.Items[i] as ValueColor; if (!this.C_LBSelFields.SelectedIndices.Contains(i)) { InitValues.Add(elet.Copy()); } } this.valuesColor = InitValues; this.SetView(); this.C_LBSelFields.SelectedIndex = -1; this.C_PropertyGrid.SelectedObject = null; }