如上所述here如何在AddinManager上“注册ConditionType的实例”?
答案 0 :(得分:1)
您在文档中发现了一个空白。它现在已更新。
要使用具有本地条件的扩展点,您必须创建扩展上下文,设置条件,然后查询扩展点。例如:
// Create an extension context to be used to query the extension point using
// a specific set of conditions.
ExtensionContext ctx = AddinManager.CreateExtensionContext ();
// Create and register the extension point condition
OpenFileLocalCondition condition = new OpenFileLocalCondition (someFileName);
ctx.RegisterCondition (condition);
// Query the extension point
foreach (ExtensionNode node in ctx.GetExtensionNodes ("/TextEditor/ContextMenu"))
(...)
您在上下文中注册的条件仅适用于该上下文,因此您可以使用不同条件集的多个上下文。