Skip to content

Instantly share code, notes, and snippets.

@nickdarnell
Created June 28, 2015 12:15
Show Gist options
  • Save nickdarnell/3bc23f0c39998dbcdddc to your computer and use it in GitHub Desktop.
Save nickdarnell/3bc23f0c39998dbcdddc to your computer and use it in GitHub Desktop.
public sealed class MyPackage : Package
{
private DTE mdte;
protected override void Initialize()
{
// Your package is also a service container IServiceContainer
serviceContainer = this as IServiceContainer;
// The DTE object contains most of the goodies you'll want to play with
mdte = serviceContainer.GetService(typeof(SDTE))as DTE;
// I could also add a service of my own if I wanted
// serviceContainer.AddService(typeof(MyService), new MyService(), true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment