Partilhar via


MarkerFormatDefinition Class

Provides coloring information for text markers.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition
    Microsoft.VisualStudio.Text.Classification.MarkerFormatDefinition

Namespace:  Microsoft.VisualStudio.Text.Classification
Assembly:  Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)

Syntax

'Declaração
Public MustInherit Class MarkerFormatDefinition _
    Inherits EditorFormatDefinition
public abstract class MarkerFormatDefinition : EditorFormatDefinition
public ref class MarkerFormatDefinition abstract : public EditorFormatDefinition
[<AbstractClass>]
type MarkerFormatDefinition =  
    class
        inherit EditorFormatDefinition
    end
public abstract class MarkerFormatDefinition extends EditorFormatDefinition

The MarkerFormatDefinition type exposes the following members.

Constructors

  Name Description
Protected method MarkerFormatDefinition Initializes a new instance of MarkerFormatDefinition.

Top

Properties

  Name Description
Public property BackgroundBrush Gets or sets the background brush for this item. (Inherited from EditorFormatDefinition.)
Public property BackgroundColor Gets or sets the background color for this item. (Inherited from EditorFormatDefinition.)
Public property BackgroundCustomizable Determines whether the background of this format is customizable. (Inherited from EditorFormatDefinition.)
Protected property Border The pen is used to draw the border of the text marker.
Public property DisplayName Defines the string used when displaying this format definition to the user. This property is used only if the UserVisibleAttribute is set to true on this object's export. (Inherited from EditorFormatDefinition.)
Protected property Fill The brush is used to paint the inner body of the text marker.
Public property ForegroundBrush Gets or sets the foreground brush for this item. (Inherited from EditorFormatDefinition.)
Public property ForegroundColor Gets or sets the foreground color for this item. (Inherited from EditorFormatDefinition.)
Public property ForegroundCustomizable Determines whether the foreground of this format is customizable. (Inherited from EditorFormatDefinition.)
Protected property ZOrder Represents the Z-order of the marker when it is drawn on the text marker adornment layer.

Top

Methods

  Name Description
Public method CreateResourceDictionary Creates a ResourceDictionary from this definition. (Inherited from EditorFormatDefinition.)
Protected method CreateResourceDictionaryFromDefinition Creates a ResourceDictionary using this definition. (Overrides EditorFormatDefinition.CreateResourceDictionaryFromDefinition().)
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Fields

  Name Description
Public fieldStatic member BorderId The string used to look up the border pen value in the ResourceDictionary.
Public fieldStatic member FillId The string used to lookup the fill brush value in the ResourceDictionary.
Public fieldStatic member ZOrderId The string used to lookup the z-order value in the ResourceDictionary.

Top

Remarks

This is a MEF component part, and should be exported as: [Export(typeof(EditorFormatDefinition))] 

Exporters must provide the attribute NameAttribute.

The MarkerFormatDefinition is consumed by the default visual manager for the TextMarkerTag. The Type property should correspond to the NameAttribute of this export so that the desired color can be correctly loaded for the text marker.

Examples

For an example of creating a marker format definition, see Walkthrough: Highlighting Text.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Text.Classification Namespace