Microsoft.VisualStudio.Project.SingleFileGenerator.RunGenerator C# (CSharp) Method

RunGenerator() public method

Runs the generator on the current project item.
public RunGenerator ( string document ) : void
document string
return void
        public virtual void RunGenerator(string document)
        {
            // Go run the generator on that node, but only if the file is dirty
            // in the running document table.  Otherwise there is no need to rerun
            // the generator because if the original document is not dirty then
            // the generated output should be already up to date.
            uint itemid = VSConstants.VSITEMID_NIL;
            IVsHierarchy hier = (IVsHierarchy)this.projectMgr;
            if(document != null && hier != null && ErrorHandler.Succeeded(hier.ParseCanonicalName((string)document, out itemid)))
            {
                IVsHierarchy rdtHier;
                IVsPersistDocData perDocData;
                uint cookie;
                if(this.VerifyFileDirtyInRdt((string)document, out rdtHier, out perDocData, out cookie))
                {
                    // Run the generator on the indicated document
                    FileNode node = (FileNode)this.projectMgr.NodeFromItemId(itemid);
                    this.InvokeGenerator(node);
                }
            }
        }