internal static void InitializeMarkerIds(VSPackage package) { // Retrieve the Text Marker IDs. We need them to be able to create instances. IVsTextManager textManager = (IVsTextManager)package.GetService(typeof(SVsTextManager)); int markerId; Guid markerGuid = Guids.GuidCloneBackgroundMarker; ErrorHandler.ThrowOnFailure(textManager.GetRegisteredMarkerTypeID(ref markerGuid, out markerId)); CloneBackgroundMarkerType.Id = markerId; markerGuid = Guids.GuidCloneMarginMarker; ErrorHandler.ThrowOnFailure(textManager.GetRegisteredMarkerTypeID(ref markerGuid, out markerId)); CloneMarginMarkerType.Id = markerId; }
/// <summary> /// Default constructor of the package. /// Inside this method you can place any initialization code that does not require /// any Visual Studio service because at this point the package object is created but /// not sited yet inside Visual Studio environment. The place to do all the other /// initialization is the Initialize method. /// </summary> public VSPackage() { _instance = this; }