public virtual void RaiseChangedEvent(ListWithChangedEventArgs e) { if (Changed != null) { Changed.Invoke(this, e); } }
public override void Clear() { base.Clear(); ListWithChangedEventArgs e = new ListWithChangedEventArgs(); e.Item = null; RaiseChangedEvent(e); }
public override object this[int index] { set { base[index] = value; ListWithChangedEventArgs e = new ListWithChangedEventArgs(); RaiseChangedEvent(e); } }
public override int Add(object value) { int i = base.Add(value); ListWithChangedEventArgs e = new ListWithChangedEventArgs(); e.Index = i; e.Item = value; RaiseChangedEvent(e); return(i); }
private void List_Changed(object sender, ListWithChangedEventArgs e) { if (e.Item != null) { Console.WriteLine(e.Item + " inserted into list at index " + e.Index); } else { Console.WriteLine("List is cleared"); } }