// Methods internal void AddHierarchyItemIdentity(HierarchyItemIdentity identity) { this._hierarchyIdentities[identity.HierarchyInfo] = identity; if (identity.IsNestedItem) { this._hierarchyIdentities[identity.NestedInfo] = identity; } }
//public void ClearHierarchyEvents(IVsHierarchy hierarchy) //{ // HierarchyIdentity identity = new HierarchyIdentity(hierarchy); // HierarchyEventSink sink = this.TryGetHierarchyEventSink(identity); // if (sink != null) // { // sink.Dispose(); // this._weakHierarchies.Remove(identity); // } //} public void ClearItem(HierarchyItemIdentity identity) { this._weakItems.Remove(identity); this._hierarchyIdentities.Remove(identity.HierarchyInfo); if (identity.IsNestedItem) { this._hierarchyIdentities.Remove(identity.NestedInfo); } }
public static Project GetProject(HierarchyItemIdentity hierarchyItem) { object obj2; if ((hierarchyItem != null) && ErrorHandler.Succeeded(hierarchyItem.NestedHierarchy.GetProperty(0xfffffffe, -2027, out obj2))) { return(obj2 as Project); } return(null); }
public override bool Equals(object obj) { HierarchyItemIdentity identity = obj as HierarchyItemIdentity; if (identity == null) { return(false); } return(this.HierarchyInfo == identity.HierarchyInfo); }
public static HierarchyItemIdentity Create(IVsHierarchy hierarchy, uint itemid) { HierarchyItemIdentity identity = HierarchyManager.Current.TryGetHierarchyItemIdentity(hierarchy, itemid); if (identity == null) { identity = new HierarchyItemIdentity(hierarchy, itemid); HierarchyManager.Current.AddHierarchyItemIdentity(identity); } return(identity); }
public static bool IsStartupProject(HierarchyItemIdentity hierarchyIdentity) { IVsHierarchy hierarchy; if (!IsProject(hierarchyIdentity)) { return(false); } IVsSolutionBuildManager solutionBuildManager = GlobalServices.SolutionBuildManager; if (solutionBuildManager == null) { return(false); } if ((solutionBuildManager.get_StartupProject(out hierarchy) < 0) || (hierarchy == null)) { return(false); } HierarchyItemIdentity identity = HierarchyItemIdentity.Create(hierarchy, 0xfffffffe); return(hierarchyIdentity.Equals(identity)); }
public static bool IsSolutionFolder(HierarchyItemIdentity hierarchyIdentity) { Project project = GetProject(hierarchyIdentity); return((project != null) && (project.Kind == "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}")); }
public static bool IsProject(HierarchyItemIdentity hierarchyIdentity) { return((hierarchyIdentity.NestedHierarchy is IVsProject) && (hierarchyIdentity.NestedItemID == 0xfffffffe)); }