public bool AddInChain(string Name, PropertyChangedChainEntry Prop) { // we need do protection against event infinite loop // caused by cycles in model graph // we have check if there not exists the same container // in chain already foreach (PropertyChangedChainEntry e in PropertyChain) { if (e.Cmp(Prop)) { return(false); // we skip add so we found cycle } } // new entry so just use it PropertyChain.Insert(0, Prop); PropertyNamesChian.Insert(0, Name); return(true); }
public ModelPropertyChangedEventArgs(string Name, PropertyChangedChainEntry Prop) { AddInChain(Name, Prop); }
public ModelPropertyChangedEventArgs(string Name, PropertyChangedChainEntry Prop, ModelPropertyChangedEventKind kind) : this(Name, Prop) { _changeKind = kind; }
public ListChangedType ListChangedType = ListChangedType.ItemChanged; // default is this, in case of list change this will change /// <summary> /// Compare 2 entries using its container reference /// </summary> /// <param name="other"></param> /// <returns>true if two entries have the same container</returns> public bool Cmp(PropertyChangedChainEntry other) { return(ReferenceEquals(Container, other.Container)); }