-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the 'IsNonVisibleItem' property to the 'SolutionItem' class.
- Loading branch information
1 parent
e0d1596
commit 7d555d2
Showing
3 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/toolkit/Community.VisualStudio.Toolkit.Shared/Helpers/IVsHierarchyItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Microsoft.VisualStudio.Shell; | ||
using Microsoft.VisualStudio.Shell.Interop; | ||
|
||
namespace Community.VisualStudio.Toolkit.Shared.Helpers | ||
{ | ||
/// <summary> | ||
/// Extensions for the <see cref="IVsHierarchyItem"/> interface. | ||
/// </summary> | ||
public static class VsHierarchyExtensions | ||
{ | ||
/// <summary> | ||
/// Returns the <see cref="IVsHierarchy"/> for the <see cref="IVsHierarchyItemIdentity"/> | ||
/// </summary> | ||
/// <param name="item"></param> | ||
/// <returns></returns> | ||
public static IVsHierarchy GetHierarchy(this IVsHierarchyItemIdentity item) => | ||
item.IsNestedItem ? item.NestedHierarchy : item.Hierarchy; | ||
|
||
/// <summary> | ||
/// Returns the 'ItemId' for the <see cref="IVsHierarchyItemIdentity"/> | ||
/// </summary> | ||
/// <param name="item"></param> | ||
/// <returns></returns> | ||
public static uint GetItemId(this IVsHierarchyItemIdentity item) => | ||
item.IsNestedItem ? item.NestedItemID : item.ItemID; | ||
|
||
/// <summary> | ||
/// Returns the <see cref="IVsHierarchy"/> for the <see cref="IVsHierarchyItem"/> | ||
/// </summary> | ||
/// <param name="item"></param> | ||
/// <returns></returns> | ||
public static IVsHierarchy GetHierarchy(this IVsHierarchyItem item) => | ||
item.HierarchyIdentity.GetHierarchy(); | ||
|
||
/// <summary> | ||
/// Returns the 'ItemId' for the <see cref="IVsHierarchyItem"/> | ||
/// </summary> | ||
/// <param name="item"></param> | ||
/// <returns></returns> | ||
public static uint GetItemId(this IVsHierarchyItem item) => | ||
item.HierarchyIdentity.GetItemId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters