在 IIS 7(.5) 中向网站页面添加自定义任务

发布于 2024-08-02 15:54:41 字数 83 浏览 2 评论 0原文

是否可以将任务项(或任务列表)添加到网站页面(Web 对象主页)?

我想为我的插件提供一些上下文访问权限,但我似乎找不到一个好的集成点。

Is it possible to add a TaskItem (or TaskList) to the website page (Web Objects Home Page)?

I'd like to provide some contextual access to my addin and I can't seem to find a good integration point.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笏见 2024-08-09 15:54:41

非常感谢 IIS.net 论坛上的 CarlosAg 作为此答案的基础。

  1. 创建一个子类 ProtocolProvider 并让它返回一个 TaskList 通过覆盖 GetSiteTaskListGetSitesTaskList

  2. 在您的 Module.Initialize 方法中,获取 IExtensibilityManager 来自 serviceProvider

  3. 通过调用 <将 ProtocolProvider 的实例注册到 IExtensibilityManager < a href="http://msdn.microsoft.com/en-us/library/microsoft.web.management.client.iextensibilitymanager.registerextension(VS.85,loband).aspx" rel="nofollow noreferrer">RegisterExtension< /a>.

更新

事实证明,ProtocolProvider 只能为“站点”视图提供任务列表,但可以根据选择的站点(如果有)提供不同的任务列表。

要为站点主页提供自定义任务列表(即包含功能列表),您需要实现 IHomepageTaskListProvider 并将其注册到 IExtensibilityManager 上面提到的。

IHomepageTaskListProvider 内.GetTaskList 实现,您可以通过获取 来自 IServiceProvider 并检查 ConfigurationPath.PathType 属性(它是一个 ConfigurationPathType 枚举)

Many thanks to CarlosAg on the IIS.net forums for the basis of this answer.

  1. Create a class that subclasses ProtocolProvider and have it return a TaskList by overriding GetSiteTaskList and GetSitesTaskList.

  2. In your Module.Initialize method, get an IExtensibilityManager from the serviceProvider

  3. Register an instance of your ProtocolProvider to the IExtensibilityManager by calling RegisterExtension.

Update

It turns out a ProtocolProvider can only provide a TaskList for the "Sites" view, but can provide a different TaskList depending on which site is selected (if any).

To provide a custom TaskList for a site's homepage (ie. with the list of features), you need to implement IHomepageTaskListProvider and register it with the IExtensibilityManager mentioned above.

Within the IHomepageTaskListProvider.GetTaskList implementation, you can find out if you the current "homepage" is a site or global by getting a Connection from the IServiceProvider and checking the ConfigurationPath.PathType property (it's an ConfigurationPathType enumeration)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文