ReloadItem() public method

Delegates the call to the inner hierarchy.
public ReloadItem ( uint reserved ) : void
reserved uint Reserved parameter defined at the IVsPersistHierarchyItem2::ReloadItem parameter.
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Called to reload a project item.
        /// Reloads a project and its nested project nodes.
        /// </summary>
        /// <param name="itemId">Specifies itemid from VSITEMID.</param>
        /// <param name="reserved">Reserved.</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code. </returns>
        public override int ReloadItem(uint itemId, uint reserved)
        {
            #region precondition
            if (this.IsClosed)
            {
                return(VSConstants.E_FAIL);
            }
            #endregion

            NestedProjectNode node = this.NodeFromItemId(itemId) as NestedProjectNode;

            if (node != null)
            {
                object propertyAsObject = node.GetProperty((int)__VSHPROPID.VSHPROPID_HandlesOwnReload);

                if (propertyAsObject != null && (bool)propertyAsObject)
                {
                    node.ReloadItem(reserved);
                }
                else
                {
                    this.ReloadNestedProjectNode(node);
                }

                return(VSConstants.S_OK);
            }

            return(base.ReloadItem(itemId, reserved));
        }