我如何一个窗口环境,所以我可以创建一个ReSharper的插件NavigationOptions [英] How do I get a window context so I can create NavigationOptions in a resharper plugin

查看:151
本文介绍了我如何一个窗口环境,所以我可以创建一个ReSharper的插件NavigationOptions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个导航插件我要扩展到允许范围内导航支持。我有我需要的一切除了NavigationOptions实例。在我的 INavigateFromHereProvider 我得到所谓与 IDataContext 等都可以创建 NavigationOptions 此使用 NavigationOptions.FromDataContext 方法。大。

I have a navigation plugin which I want to extend to allow support for context navigation. I've got everything I need except for the NavigationOptions instance. In my INavigateFromHereProvider I get called with an IDataContext so can create the NavigationOptions from this using the NavigationOptions.FromDataContext method. Great.

在我的情况下采取行动,我不被调用了 IDataContext ,我得到赋予了 ICSharpContextActionDataProvider 。我可以让我的 IDeclaredElement 此立足我的导航的决定,但我不知道如何创建我的 NavigationOptions 实例。这感觉就像我应该使用 NavigationOptions.FromWindowContext 但我似乎需要一个 PopupWindowContextSource ,我不知道在哪里得到其中的一个来源。

In my context action I don't get called with a IDataContext, I get given a ICSharpContextActionDataProvider during construction. I can get my IDeclaredElement from this to base my navigation decision on, but I'm not sure how to create my NavigationOptions instance. It feels like I should be using NavigationOptions.FromWindowContext but I seems to need a PopupWindowContextSource and I don't know where to get one of these from.

所以,我在哪里可以得到一个相关的 PopupWindowContextSource 以创建我的 NavigationOptions ?

So where can I get a relevant PopupWindowContextSource to create my NavigationOptions from?

推荐答案

啊,发现了答案(当然,答案)。

Ah, discovered the answer (well, an answer).

我可以使用这样的:

 var popupWindowContextSource = solution.GetComponent<MainWindowPopupWindowContext>().Source;



我不知道这是否是使用最合适的事情,但它似乎工作。

I'm not sure if this is the most appropriate thing to use, but it seems to work.

这篇关于我如何一个窗口环境,所以我可以创建一个ReSharper的插件NavigationOptions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆