0

As described here how do you " register an instance of the ConditionType" on the AddinManager?

1
  • What do you mean? The document you link seems to explain it in some detail... Aug 16, 2010 at 14:39

1 Answer 1

1

You found a gap in the documentation. It is now updated.

To use extension points with local conditions, you have to create an Extension Context, setup the conditions, and then query the extension point. For example:

// 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"))
    (...)

The conditions you register on a context only apply to that context, so you can have several contexts with different sets of conditions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.