Example #1
0
        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);
        }
Example #2
0
 public ModelPropertyChangedEventArgs(string Name, PropertyChangedChainEntry Prop)
 {
     AddInChain(Name, Prop);
 }
Example #3
0
 public ModelPropertyChangedEventArgs(string Name, PropertyChangedChainEntry Prop, ModelPropertyChangedEventKind kind) : this(Name, Prop)
 {
     _changeKind = kind;
 }
Example #4
0
            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));
            }