You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package)
17
+
{
18
+
var toolWindow = DTE.ToolWindows;
19
+
var solutionExplorer = toolWindow.SolutionExplorer;
20
+
21
+
var selectedItems = (solutionExplorer.SelectedItems as IEnumerable).OfType<UIHierarchyItem>().Select(i=>i.Object).OfType<ProjectItem>();
22
+
var selectedItem = selectedItems.FirstOrDefault();
23
+
24
+
if (selectedItem == null) return;
25
+
26
+
var project = selectedItem.ContainingProject;
27
+
var projectPath = project.FullName;
28
+
var projectName = Path.GetFileNameWithoutExtension(projectPath);
29
+
var projectDirPath = Path.GetDirectoryName(projectPath);
30
+
31
+
var filePath = selectedItem.FileNames[0];
32
+
var partPath = filePath.Substring(projectDirPath.Length);
public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package)
67
+
{
68
+
var toolWindow = DTE.ToolWindows;
69
+
70
+
var solutionExplorer = toolWindow.SolutionExplorer;
71
+
72
+
var selectedItems = (solutionExplorer.SelectedItems as IEnumerable).OfType<UIHierarchyItem>().Select(i=>i.Object).OfType<ProjectItem>();
73
+
var selectedItem = selectedItems.FirstOrDefault();
74
+
75
+
if (selectedItem == null) return;
76
+
77
+
var project = selectedItem.ContainingProject;
78
+
var projectPath = project.FullName;
79
+
var projectName = Path.GetFileNameWithoutExtension(projectPath);
80
+
var projectDirPath = Path.GetDirectoryName(projectPath);
81
+
82
+
var filePath = selectedItem.FileNames[0];
83
+
var partPath = filePath.Substring(projectDirPath.Length);
0 commit comments