Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
2a33b762
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2a33b762
编写于
6月 26, 2017
作者:
T
Tom Meschter
提交者:
GitHub
6月 26, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20410 from tmeschter/SupportInspectingSolutionExplorer
Add support for inspecting Solution Explorer items
上级
35afa309
c00f319e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
85 addition
and
2 deletion
+85
-2
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/SolutionExplorer_InProc.cs
...onTest/TestUtilities/InProcess/SolutionExplorer_InProc.cs
+56
-0
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs
.../TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs
+29
-2
未找到文件。
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/SolutionExplorer_InProc.cs
浏览文件 @
2a33b762
...
...
@@ -802,6 +802,62 @@ public void SelectItem(string itemName)
solutionExplorer
.
Parent
.
Activate
();
}
public
void
SelectItemAtPath
(
params
string
[]
path
)
{
var
dte
=
(
DTE2
)
GetDTE
();
var
solutionExplorer
=
dte
.
ToolWindows
.
SolutionExplorer
;
var
item
=
FindItemAtPath
(
solutionExplorer
.
UIHierarchyItems
,
path
);
item
.
Select
(
EnvDTE
.
vsUISelectionType
.
vsUISelectionTypeSelect
);
solutionExplorer
.
Parent
.
Activate
();
}
public
string
[]
GetChildrenOfItem
(
string
itemName
)
{
var
dte
=
(
DTE2
)
GetDTE
();
var
solutionExplorer
=
dte
.
ToolWindows
.
SolutionExplorer
;
var
item
=
FindFirstItemRecursively
(
solutionExplorer
.
UIHierarchyItems
,
itemName
);
return
item
.
UIHierarchyItems
.
Cast
<
EnvDTE
.
UIHierarchyItem
>()
.
Select
(
i
=>
i
.
Name
)
.
ToArray
();
}
public
string
[]
GetChildrenOfItemAtPath
(
params
string
[]
path
)
{
var
dte
=
(
DTE2
)
GetDTE
();
var
solutionExplorer
=
dte
.
ToolWindows
.
SolutionExplorer
;
var
item
=
FindItemAtPath
(
solutionExplorer
.
UIHierarchyItems
,
path
);
return
item
.
UIHierarchyItems
.
Cast
<
EnvDTE
.
UIHierarchyItem
>()
.
Select
(
i
=>
i
.
Name
)
.
ToArray
();
}
private
static
EnvDTE
.
UIHierarchyItem
FindItemAtPath
(
EnvDTE
.
UIHierarchyItems
currentItems
,
string
[]
path
)
{
EnvDTE
.
UIHierarchyItem
item
=
null
;
foreach
(
var
name
in
path
)
{
item
=
currentItems
.
Cast
<
EnvDTE
.
UIHierarchyItem
>().
FirstOrDefault
(
i
=>
i
.
Name
==
name
);
if
(
item
==
null
)
{
return
null
;
}
currentItems
=
item
.
UIHierarchyItems
;
}
return
item
;
}
private
static
EnvDTE
.
UIHierarchyItem
FindFirstItemRecursively
(
EnvDTE
.
UIHierarchyItems
currentItems
,
string
itemName
)
...
...
src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs
浏览文件 @
2a33b762
...
...
@@ -47,7 +47,7 @@ public void AddProject(ProjectUtils.Project projectName, string projectTemplate,
public
void
AddProjectReference
(
ProjectUtils
.
Project
fromProjectName
,
ProjectUtils
.
ProjectReference
toProjectName
)
{
_inProc
.
AddProjectReference
(
fromProjectName
.
Name
,
toProjectName
.
Name
);
_inProc
.
AddProjectReference
(
fromProjectName
.
Name
,
toProjectName
.
Name
);
_instance
.
Workspace
.
WaitForAsyncOperations
(
FeatureAttribute
.
Workspace
);
}
...
...
@@ -123,9 +123,36 @@ public string[] GetProjectReferences(ProjectUtils.Project project)
public
string
[]
GetAssemblyReferences
(
ProjectUtils
.
Project
project
)
=>
_inProc
.
GetAssemblyReferences
(
project
.
Name
);
/// <summary>
/// Selects an item named by the <paramref name="itemName"/> parameter.
/// Note that this selects the first item of the given name found. In situations where
/// there may be more than one item of a given name, use <see cref="SelectItemAtPath(string[])"/>
/// instead.
/// </summary>
public
void
SelectItem
(
string
itemName
)
=>
_inProc
.
SelectItem
(
itemName
);
/// <summary>
/// Selects the specific item at the given "path".
/// </summary>
public
void
SelectItemAtPath
(
params
string
[]
path
)
=>
_inProc
.
SelectItemAtPath
(
path
);
/// <summary>
/// Returns the names of the immediate children of the given item.
/// Note that this uses the first item of the given name found. In situations where there
/// may be more than one item of a given name, use <see cref="GetChildrenOfItemAtPath(string[])"/>
/// instead.
/// </summary>
public
string
[]
GetChildrenOfItem
(
string
itemName
)
=>
_inProc
.
GetChildrenOfItem
(
itemName
);
/// <summary>
/// Returns the names of the immediate children of the item at the given "path".
/// </summary>
public
string
[]
GetChildrenOfItemAtPath
(
params
string
[]
path
)
=>
_inProc
.
GetChildrenOfItemAtPath
(
path
);
public
void
ClearBuildOutputWindowPane
()
=>
_inProc
.
ClearBuildOutputWindowPane
();
...
...
@@ -135,7 +162,7 @@ public void WaitForBuildToFinish()
public
void
EditProjectFile
(
ProjectUtils
.
Project
project
)
=>
_inProc
.
EditProjectFile
(
project
.
Name
);
public
void
AddStandaloneFile
(
string
fileName
)
public
void
AddStandaloneFile
(
string
fileName
)
=>
_inProc
.
AddStandaloneFile
(
fileName
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录