Microsoft.VisualStudio.Project.NestedProjectNode.IsItemDirty C# (CSharp) Method

IsItemDirty() public method

Determines whether the hierarchy item changed.
public IsItemDirty ( uint itemId, IntPtr punkDocData, int &pfDirty ) : int
itemId uint Item identifier of the hierarchy item contained in VSITEMID
punkDocData System.IntPtr Pointer to the IUnknown interface of the hierarchy item.
pfDirty int TRUE if the hierarchy item changed.
return int
        public override int IsItemDirty(uint itemId, IntPtr punkDocData, out int pfDirty)
        {
            Debug.Assert(this.nestedHierarchy != null, "The nested hierarchy object must be created before calling this method");
            Debug.Assert(punkDocData != IntPtr.Zero, "docData intptr was zero");

            // Get an IPersistFileFormat object from docData object
            IPersistFileFormat persistFileFormat = Marshal.GetTypedObjectForIUnknown(punkDocData, typeof(IPersistFileFormat)) as IPersistFileFormat;
            Debug.Assert(persistFileFormat != null, "The docData object does not implement the IPersistFileFormat interface");

            // Call IsDirty on the IPersistFileFormat interface
            ErrorHandler.ThrowOnFailure(persistFileFormat.IsDirty(out pfDirty));

            return VSConstants.S_OK;
        }