- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在用 C# 创建一个小型 Visual Studio 2010 扩展,它使用 IWpfTextViewCreationListener 和 TextViewCreated 在 VS 环境中打开新的 TextView 时进行捕获。我遇到的问题是,此方法仅在通过 VS 解决方案资源管理器窗口打开新窗口时触发,而在 VS 启动时已经包含打开的窗口和切换窗口选项卡时不会触发。我试过寻找类似 TextViewChanged 的东西,但找不到这样的方法。 Is there anyway to capture the new TextView when another tabbed window is selected?
如有任何帮助,我们将不胜感激。
此问题也已发布在 MSDN VS Extensibility 论坛上: VSX 2010 - Alternative to TextViewCreated such as (TextViewChanged)?
谢谢
约翰
最佳答案
没有 TextViewCreated,但如果您在创建时注册到 IWpfTextView.GotAggregateFocus,您将获得文件之间每次切换的 Hook :
public void TextViewCreated(IWpfTextView textView)
{
textView.GotAggregateFocus += TextViewCameToFocus;
// Do stuff when a new IWpfTextView is created...
}
void TextViewCameToFocus(object sender, EventArgs e)
{
var focusedTextView = (IWpfTextView)sender;
// Do stuff when a specific IWpfTextView comes to focus...
}
如果您希望能够将激发的事件与每个 TextView 的逻辑联系起来,您可能还需要跟踪 IWpfTextView 对象。
关于c# - 替代 TextViewCreated,例如(TextViewChanged)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3779198/
我正在用 C# 创建一个小型 Visual Studio 2010 扩展,它使用 IWpfTextViewCreationListener 和 TextViewCreated 在 VS 环境中打开新的
我是一名优秀的程序员,十分优秀!