Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
4d0d69ae
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,发现更多精彩内容 >>
提交
4d0d69ae
编写于
9月 11, 2015
作者:
A
Andrew Casey
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5150 from amcasey/AutonomousFind
Use the new Find LaF in Interactive
上级
41764707
b369db19
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
121 deletion
+7
-121
src/InteractiveWindow/VisualStudio/VsInteractiveWindow.cs
src/InteractiveWindow/VisualStudio/VsInteractiveWindow.cs
+7
-121
未找到文件。
src/InteractiveWindow/VisualStudio/VsInteractiveWindow.cs
浏览文件 @
4d0d69ae
...
...
@@ -7,7 +7,6 @@
using
System.Runtime.InteropServices
;
using
System.Windows
;
using
System.Windows.Input
;
using
Microsoft.VisualStudio
;
using
Microsoft.VisualStudio.ComponentModelHost
;
using
Microsoft.VisualStudio.Editor
;
using
Microsoft.VisualStudio.OLE.Interop
;
...
...
@@ -15,7 +14,6 @@
using
Microsoft.VisualStudio.Shell.Interop
;
using
Microsoft.VisualStudio.Text.Editor
;
using
Microsoft.VisualStudio.TextManager.Interop
;
using
Microsoft.VisualStudio.InteractiveWindow
;
using
Microsoft.VisualStudio.Utilities
;
namespace
Microsoft.VisualStudio.InteractiveWindow.Shell
...
...
@@ -32,8 +30,11 @@ namespace Microsoft.VisualStudio.InteractiveWindow.Shell
/// on the interactive window.
/// </summary>
[
Guid
(
Guids
.
InteractiveToolWindowIdString
)]
internal
sealed
class
VsInteractiveWindow
:
ToolWindowPane
,
I
VsFindTarget
,
I
OleCommandTarget
,
IVsInteractiveWindow
internal
sealed
class
VsInteractiveWindow
:
ToolWindowPane
,
IOleCommandTarget
,
IVsInteractiveWindow
{
// Keep in sync with Microsoft.VisualStudio.Editor.Implementation.EnableFindOptionDefinition.OptionName.
private
const
string
EnableFindOptionName
=
"Enable Autonomous Find"
;
private
readonly
IComponentModel
_componentModel
;
private
readonly
IVsEditorAdaptersFactoryService
_editorAdapters
;
...
...
@@ -93,7 +94,9 @@ protected override void OnCreate()
_window
=
_componentModel
.
GetService
<
IInteractiveWindowFactoryService
>().
CreateWindow
(
_evaluator
);
_window
.
SubmissionBufferAdded
+=
SubmissionBufferAdded
;
_textViewHost
=
_window
.
GetTextViewHost
();
var
viewAdapter
=
_editorAdapters
.
GetViewAdapter
(
_textViewHost
.
TextView
);
var
textView
=
_textViewHost
.
TextView
;
textView
.
Options
.
SetOptionValue
(
EnableFindOptionName
,
true
);
var
viewAdapter
=
_editorAdapters
.
GetViewAdapter
(
textView
);
_findTarget
=
viewAdapter
as
IVsFindTarget
;
_commandTarget
=
viewAdapter
as
IOleCommandTarget
;
}
...
...
@@ -187,122 +190,5 @@ private IVsToolWindowToolbarHost GetToolbarHost()
}
#
endregion
#
region
IVsFindTarget
public
int
Find
(
string
pszSearch
,
uint
grfOptions
,
int
fResetStartPoint
,
IVsFindHelper
pHelper
,
out
uint
pResult
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
Find
(
pszSearch
,
grfOptions
,
fResetStartPoint
,
pHelper
,
out
pResult
);
}
pResult
=
0
;
return
VSConstants
.
E_NOTIMPL
;
}
public
int
GetCapabilities
(
bool
[]
pfImage
,
uint
[]
pgrfOptions
)
{
if
(
_findTarget
!=
null
&&
pgrfOptions
!=
null
&&
pgrfOptions
.
Length
>
0
)
{
return
_findTarget
.
GetCapabilities
(
pfImage
,
pgrfOptions
);
}
return
VSConstants
.
E_NOTIMPL
;
}
public
int
GetCurrentSpan
(
TextSpan
[]
pts
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
GetCurrentSpan
(
pts
);
}
return
VSConstants
.
E_NOTIMPL
;
}
public
int
GetFindState
(
out
object
ppunk
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
GetFindState
(
out
ppunk
);
}
ppunk
=
null
;
return
VSConstants
.
E_NOTIMPL
;
}
public
int
GetMatchRect
(
RECT
[]
prc
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
GetMatchRect
(
prc
);
}
return
VSConstants
.
E_NOTIMPL
;
}
public
int
GetProperty
(
uint
propid
,
out
object
pvar
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
GetProperty
(
propid
,
out
pvar
);
}
pvar
=
null
;
return
VSConstants
.
E_NOTIMPL
;
}
public
int
GetSearchImage
(
uint
grfOptions
,
IVsTextSpanSet
[]
ppSpans
,
out
IVsTextImage
ppTextImage
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
GetSearchImage
(
grfOptions
,
ppSpans
,
out
ppTextImage
);
}
ppTextImage
=
null
;
return
VSConstants
.
E_NOTIMPL
;
}
public
int
MarkSpan
(
TextSpan
[]
pts
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
MarkSpan
(
pts
);
}
return
VSConstants
.
E_NOTIMPL
;
}
public
int
NavigateTo
(
TextSpan
[]
pts
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
NavigateTo
(
pts
);
}
return
VSConstants
.
E_NOTIMPL
;
}
public
int
NotifyFindTarget
(
uint
notification
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
NotifyFindTarget
(
notification
);
}
return
VSConstants
.
E_NOTIMPL
;
}
public
int
Replace
(
string
pszSearch
,
string
pszReplace
,
uint
grfOptions
,
int
fResetStartPoint
,
IVsFindHelper
pHelper
,
out
int
pfReplaced
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
Replace
(
pszSearch
,
pszReplace
,
grfOptions
,
fResetStartPoint
,
pHelper
,
out
pfReplaced
);
}
pfReplaced
=
0
;
return
VSConstants
.
E_NOTIMPL
;
}
public
int
SetFindState
(
object
pUnk
)
{
if
(
_findTarget
!=
null
)
{
return
_findTarget
.
SetFindState
(
pUnk
);
}
return
VSConstants
.
E_NOTIMPL
;
}
#
endregion
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录