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

IgnoreItemFileChanges() public method

Flag indicating that changes to a file can be ignored when item is saved or reloaded.
public IgnoreItemFileChanges ( bool ignoreFlag ) : void
ignoreFlag bool Flag indicating whether or not to ignore changes (1 to ignore, 0 to stop ignoring).
return void
        public override void IgnoreItemFileChanges(bool ignoreFlag)
        {
            #region precondition
            if (this.isDisposed || this.ProjectManager == null || this.ProjectManager.IsClosed)
            {
                throw new InvalidOperationException();
            }

            Debug.Assert(this.nestedHierarchy != null, "The nested hierarchy object must be created before calling this method");
            #endregion

            this.IgnoreNestedProjectFile(ignoreFlag);

            IVsPersistHierarchyItem2 persistHierachyItem = this.nestedHierarchy as IVsPersistHierarchyItem2;

            // If the IVsPersistHierarchyItem2 is not implemented by the nested just return
            if (persistHierachyItem == null)
            {
                return;
            }

            ErrorHandler.ThrowOnFailure(persistHierachyItem.IgnoreItemFileChanges(VSConstants.VSITEMID_ROOT, ignoreFlag ? 1 : 0));
        }