public bool Equals(CollectionEvent <T> otherEvent, SCG.IEqualityComparer <T> itemequalityComparer) { if (otherEvent == null || Act != otherEvent.Act || !object.ReferenceEquals(Sender, otherEvent.Sender)) { return(false); } switch (Act) { case EventTypeEnum.None: break; case EventTypeEnum.Changed: return(true); case EventTypeEnum.Cleared: if (Args is ClearedRangeEventArgs) { ClearedRangeEventArgs a = Args as ClearedRangeEventArgs, o = otherEvent.Args as ClearedRangeEventArgs; if (o == null) { return(false); } return(a.Full == o.Full && a.Start == o.Start && a.Count == o.Count); } else { if (otherEvent.Args is ClearedRangeEventArgs) { return(false); } ClearedEventArgs a = Args as ClearedEventArgs, o = otherEvent.Args as ClearedEventArgs; return(a.Full == o.Full && a.Count == o.Count); } case EventTypeEnum.Added: { ItemCountEventArgs <T> a = Args as ItemCountEventArgs <T>, o = otherEvent.Args as ItemCountEventArgs <T>; return(itemequalityComparer.Equals(a.Item, o.Item) && a.Count == o.Count); } case EventTypeEnum.Removed: { ItemCountEventArgs <T> a = Args as ItemCountEventArgs <T>, o = otherEvent.Args as ItemCountEventArgs <T>; return(itemequalityComparer.Equals(a.Item, o.Item) && a.Count == o.Count); } case EventTypeEnum.Inserted: { ItemAtEventArgs <T> a = Args as ItemAtEventArgs <T>, o = otherEvent.Args as ItemAtEventArgs <T>; return(a.Index == o.Index && itemequalityComparer.Equals(a.Item, o.Item)); } case EventTypeEnum.RemovedAt: { ItemAtEventArgs <T> a = Args as ItemAtEventArgs <T>, o = otherEvent.Args as ItemAtEventArgs <T>; return(a.Index == o.Index && itemequalityComparer.Equals(a.Item, o.Item)); } } throw new ApplicationException("Illegal Action: " + Act); }
void queue_ItemRemoved(object sender, ItemCountEventArgs <int> e) { events.Add(new KeyValuePair <Acts, int>(Acts.Remove, e.Item)); }
void w_ItemRemoved(object sender, ItemCountEventArgs<int> eventArgs) { throw new NotImplementedException(); }
void removed(object sender, ItemCountEventArgs <T> eventArgs) { happened.Add(new CollectionEvent <T>(EventTypeEnum.Removed, eventArgs, sender)); }
void queue_ItemRemoved(object sender, ItemCountEventArgs<int> e) { events.Add(new KeyValuePair<Acts, int>(Acts.Remove, e.Item)); }
private void DecrementCount(Object sender, ItemCountEventArgs <V> args) { count -= args.Count; }
private void queue_ItemAdded(object sender, ItemCountEventArgs <int> e) { events.Add(new KeyValuePair <Acts, int>(Acts.Add, e.Item)); }
private void w_ItemRemoved(object sender, ItemCountEventArgs <int> eventArgs) { throw new NotImplementedException(); }
private void queue_ItemRemoved(object sender, ItemCountEventArgs <int> e) { events.Add(new System.Collections.Generic.KeyValuePair <Acts, int>(Acts.Remove, e.Item)); }
private int count = 0; // Cached value count, updated by events only private void IncrementCount(object sender, ItemCountEventArgs <V> args) { count += args.Count; }
void queue_ItemAdded(object sender, ItemCountEventArgs<int> e) { events.Add(new C5.KeyValuePair<Acts, int>(Acts.Add, e.Item)); }
private void added(object sender, ItemCountEventArgs <T> eventArgs) { happened.Add(new CollectionEvent <T>(EventType.Added, eventArgs, sender)); }
/// <summary> /// This event is added when a sprite is added to this sprite /// list. /// </summary> private void OnSpriteAdded( object sender, ItemCountEventArgs <ISprite> args) { args.Item.Invalidate += OnSpriteInvalidated; }