Beispiel #1
0
        // --------------------------------------------------------------------------------------------
        /// <summary>
        /// This method is executed when a new item is added to the hierarchy node.
        /// </summary>
        /// <param name="parent">Parent of the node.</param>
        /// <param name="child">Child node added.</param>
        // --------------------------------------------------------------------------------------------
        protected void OnItemAdded(HierarchyNode parent, HierarchyNode child)
        {
            if (null != parent._OnChildAdded)
            {
                var args = new HierarchyNodeEventArgs(child);
                parent._OnChildAdded(parent, args);
            }
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }

            // --- Check if the manager node wants to trigger this event
            var  prev   = child.PreviousSibling;
            uint prevId = (prev != null) ? (uint)prev.HierarchyId : VSConstants.VSITEMID_NIL;

            ManagerNode.RaiseHierarchyEvent(
                sink => sink.OnItemAdded((uint)parent.HierarchyId, prevId, (uint)child.HierarchyId));
        }
Beispiel #2
0
 public void InvalidateItem()
 {
     ManagerNode.RaiseHierarchyEvent(sink =>
                                     sink.OnInvalidateItems((uint)HierarchyId));
 }