Ejemplo n.º 1
0
        internal void RemoveFromChildrenList_Children(ChildrenList_Child childrenList_Child)
        {
#if DEBUG
            if (!childrenList_Children.Remove(childrenList_Child))
            {
                throw new Exception();
            }
#else
            childrenList_Children.Remove(childrenList_Child);
#endif
            onRemovedFromChildrenList_Children(childrenList_Child);
#if DEBUG
            DC.Trace?.Invoke($"Remove ChildrenList_Child {childrenList_Child.GetKeyOrHash()} from " +
                             $"{this.GetKeyOrHash()} ChildrenList_CreateOnlyParent.ChildrenList_Children");
#endif
        }
Ejemplo n.º 2
0
        internal void AddToChildrenList_Children(ChildrenList_Child childrenList_Child)
        {
#if DEBUG
            if (childrenList_Child == ChildrenList_Child.NoChildrenList_Child)
            {
                throw new Exception();
            }
            if ((childrenList_Child.Key >= 0) && (Key < 0))
            {
                throw new Exception();
            }
            if (childrenList_Children.Contains(childrenList_Child))
            {
                throw new Exception();
            }
#endif
            childrenList_Children.Add(childrenList_Child);
            onAddedToChildrenList_Children(childrenList_Child);
#if DEBUG
            DC.Trace?.Invoke($"Add ChildrenList_Child {childrenList_Child.GetKeyOrHash()} to " +
                             $"{this.GetKeyOrHash()} ChildrenList_CreateOnlyParent.ChildrenList_Children");
#endif
        }