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