Created
April 19, 2013 15:11
-
-
Save sharwell/5421001 to your computer and use it in GitHub Desktop.
Minimal implementation of `Package` to register and provide an implementation of `IVsLanguageInfo`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using Microsoft.VisualStudio.Shell; | |
using IServiceContainer = System.ComponentModel.Design.IServiceContainer; | |
[PackageRegistration(UseManagedResourcesOnly = true)] | |
[InstalledProductRegistration("#110", "#111", "1.0")] | |
[ProvideLanguageService(typeof(ExampleLanguageInfo), "Example", 100)] | |
[ProvideLanguageExtension(typeof(ExampleLanguageInfo), ".e1")] | |
[ProvideLanguageExtension(typeof(ExampleLanguageInfo), ".e2")] | |
[Guid("your guid here")] | |
public class ExamplePackage : Package | |
{ | |
private ExampleLanguageInfo _languageInfo; | |
protected override void Initialize() | |
{ | |
base.Initialize(); | |
_languageInfo = new ExampleLanguageInfo(); | |
((IServiceContainer)this).AddService(typeof(ExampleLanguageInfo), _languageInfo, true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you please provide detailed assembly version info?