提交 b369db19 编写于 作者: A Andrew Casey

Stop explicitly implementing IVsFindTarget

Explicit implementers can't use the new Find Look-and-Feel without also
using private hooks (per @dpugh).  Since we were only delegating down the
chain, which is what would happen anyway, there's no need for us to do so.
上级 92893916
......@@ -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,7 +30,7 @@ namespace Microsoft.VisualStudio.InteractiveWindow.Shell
/// on the interactive window.
/// </summary>
[Guid(Guids.InteractiveToolWindowIdString)]
internal sealed class VsInteractiveWindow : ToolWindowPane, IVsFindTarget, IOleCommandTarget, 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";
......@@ -192,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.
先完成此消息的编辑!
想要评论请 注册