LanguagePreferences.OnRegisterMarkerType(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called when a new marker type is registered with Visual Studio.
public:
virtual int OnRegisterMarkerType(int iMarkerType);
public:
virtual int OnRegisterMarkerType(int iMarkerType);
virtual int OnRegisterMarkerType(int iMarkerType);
public virtual int OnRegisterMarkerType (int iMarkerType);
abstract member OnRegisterMarkerType : int -> int
override this.OnRegisterMarkerType : int -> int
Public Overridable Function OnRegisterMarkerType (iMarkerType As Integer) As Integer
Parameters
- iMarkerType
- Int32
[in] The ID of the marker type.
Returns
Implements
Examples
Here is an example of how to obtain the IVsTextManager2 interface and get the marker type.
using Microsoft.VisualStudio.Package;
namespace MyLanguagePackage
{
class MyLanguagePreferences : LanguagePreferences
{
override public void OnRegisterMarkerType(int iMarkerType)
{
IVsTextManager2 pTextManager;
pTextManager = Site.GetService(typeof(SVsTextManager)) as IVsTextManager2;
if (pTextManager != null)
{
IVsTextMarkerType pMarkerType;
pTextManager.GetMarkerTypeInterface(iMarkerType,out pMarkerType);
if (pMarkerType != null)
{
// Examine marker type here.
}
}
}
}
}
Remarks
This method is called whenever a new marker type is registered. Call the GetMarkerTypeInterface method with the specified marker ID to obtain an IVsTextMarkerType object that can be queried for details on the new marker type. A language service typically does not need to implement this method.
This method is an implementation of Microsoft.VisualStudio.TextManager.Interop.IVsTextManagerEvents2.OnRegisterMarkerType.
The base method does nothing.