Mike Minutillo
Mike Minutillo

Reputation: 54829

How do I create an Editor Option in the new VS2010 Editor Extensibilty

The list of extensibility points for the VS2010 Editor mentios creating EditorOptionDefinitions along with a small sample. When I attempt to do this I cannot find the options anywhere in the VS2010 UI. How do I create these so that they are surfaced in the UI?

Upvotes: 3

Views: 271

Answers (1)

JaredPar
JaredPar

Reputation: 755151

To define a new Editor option in Vs2010 you need to do the following

  1. Create a class which derives from EditorOPtionDefinition or EditorOptionDefinition<T>
  2. Add an export of EditorOptionDefinition.
  3. Make sure the assembly where this is defined is listed as a MEF component

Example

[Export(typeof(EditorOptionDefinition))]
public sealed class SomeNewOption : EditorOptionDefinition<string> {
  public override Default { get ... } 
  public override EditorOptionKey<string> Key { get ... }
}

Upvotes: 3

Related Questions