public virtual void CloseNestedProjectNode()
{
if (this.isDisposed || this.ProjectManager == null || this.ProjectManager.IsClosed)
{
return;
}
uint itemid = VSConstants.VSITEMID_NIL;
try
{
this.DisconnectPropertyNotifySink();
IVsUIHierarchy hier;
IVsWindowFrame windowFrame;
VsShellUtilities.IsDocumentOpen(this.ProjectManager.Site, this.ProjectPath, Guid.Empty, out hier, out itemid, out windowFrame);
if (itemid == VSConstants.VSITEMID_NIL)
{
this.UnlockRdtEntry();
}
IVsSolution solution = this.GetService(typeof(IVsSolution)) as IVsSolution;
if (solution == null)
{
throw new InvalidOperationException();
}
ErrorHandler.ThrowOnFailure(solution.RemoveVirtualProject(this.nestedHierarchy, 0));
}
finally
{
this.StopObservingNestedProjectFile();
// if we haven't already release the RDT cookie, do so now.
if (itemid == VSConstants.VSITEMID_NIL)
{
this.UnlockRdtEntry();
}
this.Dispose(true);
}
}