Example #1
0
        protected void OnNodeChildrenChanged(NodeChildrenChangedArgs <T> args)
        {
            var handler = NodeChildrenChanged;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Example #2
0
 private void m_parent_NodeChildrenChanged(object sender, NodeChildrenChangedArgs <T> args)
 {
     if (args.Parent.Equals(this.m_item))
     {
         if (args.Action == NotifyCollectionChangedAction.Add)
         {
             Debug.Assert(!m_children.Contains(m_parent[args.Child]));
             m_children.Add(m_parent[args.Child]);
         }
         else if (args.Action == NotifyCollectionChangedAction.Remove)
         {
             Debug.Assert(m_children.Contains(m_parent[args.Child]));
             m_children.Remove(m_parent[args.Child]);
         }
         else
         {
             throw new InvalidOperationException();
         }
     }
     else
     {
         Debug.Assert(args.Parent != null);
     }
 }