Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created September 13, 2014 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JoshVarty/12051843c85331330737 to your computer and use it in GitHub Desktop.
Save JoshVarty/12051843c85331330737 to your computer and use it in GitHub Desktop.
protected override void Initialize()
{
//Other stuff...
...
var componentModel = (IComponentModel)this.GetService(typeof(SComponentModel));
var workspace = componentModel.GetService<Microsoft.VisualStudio.LanguageServices.VisualStudioWorkspace>();
}
//Alternatively you can MEF import the workspace. MEF can be tricky if you're not familiar with it
//but here's how you'd import VisuaStudioWorkspace as a property.
[Import(typeof(Microsoft.VisualStudio.LanguageServices.VisualStudioWorkspace))]
public VisualStudioWorkspace myWorkspace { get; set; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment