本文整理汇总了C#中IVsTextView.RemoveCommandFilter方法的典型用法代码示例。如果您正苦于以下问题:C# IVsTextView.RemoveCommandFilter方法的具体用法?C# IVsTextView.RemoveCommandFilter怎么用?C# IVsTextView.RemoveCommandFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVsTextView
的用法示例。
在下文中一共展示了IVsTextView.RemoveCommandFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VsTextViewCreated
public async void VsTextViewCreated(IVsTextView textViewAdapter)
{
IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter);
Debug.Assert(view != null);
int tries = 0;
// Ugly ugly hack
// Keep trying to register our filter until after the JSLS CommandFilter
// is added so we can catch completion before JSLS swallows all of them.
// To confirm this, click Debug, New Breakpoint, Break at Function, type
// Microsoft.VisualStudio.JSLS.TextView.TextView.CreateCommandFilter,
// then make sure that our last filter is added after that runs.
JsCommandFilter filter = new JsCommandFilter(view, CompletionBroker, _standardClassifications);
while (true)
{
IOleCommandTarget next;
textViewAdapter.AddCommandFilter(filter, out next);
filter.Next = next;
if (IsJSLSInstalled(next) || ++tries > 10)
return;
await Task.Delay(500);
textViewAdapter.RemoveCommandFilter(filter); // Remove the too-early filter and try again.
}
}
示例2: OnActiveViewChanged
/// <summary>
/// Called when [active view changed].
/// </summary>
/// <param name="textView">The text view.</param>
public override void OnActiveViewChanged(IVsTextView textView)
{
base.OnActiveViewChanged(textView);
//Currently filters is not used.
if (textView != null)
{
IOleCommandTarget target;
LuaCommandFilter commandFilter = LuaCommandFilter.GetCommandFilter(this);
textView.RemoveCommandFilter(commandFilter);
textView.AddCommandFilter(commandFilter, out target);
commandFilter.VsCommandFilter = target;
}
else
{
//textView.RemoveCommandFilter()
}
}
示例3: RemoveKeyBindingFilter
private void RemoveKeyBindingFilter(IVsTextView vsTextView)
{
vsTextView.RemoveCommandFilter(_keyBindingCommandFilter);
}