Example #1
0
        internal void RemoveFromDemoChildren(DemoChild demoChild)
        {
#if DEBUG
            if (!demoChildren.Remove(demoChild))
            {
                throw new Exception();
            }
#else
            demoChildren.Remove(demoChild);
#endif
            onRemovedFromDemoChildren(demoChild);
#if DEBUG
            DC.Trace?.Invoke($"Remove DemoChild {demoChild.GetKeyOrHash()} from " +
                             $"{this.GetKeyOrHash()} DemoParent.DemoChildren");
#endif
        }
Example #2
0
        internal void AddToDemoChildren(DemoChild demoChild)
        {
#if DEBUG
            if (demoChild == DemoChild.NoDemoChild)
            {
                throw new Exception();
            }
            if ((demoChild.Key >= 0) && (Key < 0))
            {
                throw new Exception();
            }
            if (demoChildren.Contains(demoChild))
            {
                throw new Exception();
            }
#endif
            demoChildren.Add(demoChild);
            onAddedToDemoChildren(demoChild);
#if DEBUG
            DC.Trace?.Invoke($"Add DemoChild {demoChild.GetKeyOrHash()} to " +
                             $"{this.GetKeyOrHash()} DemoParent.DemoChildren");
#endif
        }
Example #3
0
 /// <summary>
 /// Called after a demoChild gets removed from DemoChildren.
 /// </summary>
 partial void onRemovedFromDemoChildren(DemoChild demoChild)
 {
 }
Example #4
0
 /// <summary>
 /// Called after a demoChild gets added to DemoChildren.
 /// </summary>
 partial void onAddedToDemoChildren(DemoChild demoChild)
 {
 }