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;
}