Поделиться через


TextFormattingRunProperties Class

Holds text formatting property information. This class derives from the abstract TextRunProperties class.

Inheritance Hierarchy

System.Object
  System.Windows.Media.TextFormatting.TextRunProperties
    Microsoft.VisualStudio.Text.Formatting.TextFormattingRunProperties

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

Syntax

'Декларация
<SerializableAttribute> _
Public NotInheritable Class TextFormattingRunProperties _
    Inherits TextRunProperties _
    Implements ISerializable, IObjectReference
[SerializableAttribute]
public sealed class TextFormattingRunProperties : TextRunProperties, 
    ISerializable, IObjectReference
[SerializableAttribute]
public ref class TextFormattingRunProperties sealed : public TextRunProperties, 
    ISerializable, IObjectReference
[<Sealed>]
[<SerializableAttribute>]
type TextFormattingRunProperties =  
    class
        inherit TextRunProperties
        interface ISerializable
        interface IObjectReference
    end
public final class TextFormattingRunProperties extends TextRunProperties implements ISerializable, IObjectReference

The TextFormattingRunProperties type exposes the following members.

Properties

  Name Description
Public property BackgroundBrush Gets the background brush. (Overrides TextRunProperties.BackgroundBrush.)
Public property BackgroundBrushEmpty Determines whether the background brush is empty.
Public property BackgroundOpacity Returns the opacity of the background.
Public property BackgroundOpacityEmpty Determines whether any custom opacity is explicitly set for the background.
Public property BaselineAlignment Gets the baseline style for a text that is positioned on the vertical axis. (Inherited from TextRunProperties.)
Public property Bold Determines whether the formatting is made explicitly bold.
Public property BoldEmpty Determines whether the bold property is set.
Public property CultureInfo Gets the culture information. (Overrides TextRunProperties.CultureInfo.)
Public property CultureInfoEmpty Determines whether the culture info is empty.
Public property FontHintingEmSize Gets the font hinting size. (Overrides TextRunProperties.FontHintingEmSize.)
Public property FontHintingEmSizeEmpty Determines whether the font hinting size is empty.
Public property FontRenderingEmSize Gets the font rendering size. (Overrides TextRunProperties.FontRenderingEmSize.)
Public property FontRenderingEmSizeEmpty Determines whether the size is empty.
Public property ForegroundBrush Gets the foreground brush. (Overrides TextRunProperties.ForegroundBrush.)
Public property ForegroundBrushEmpty Determines whether the foreground brush is empty.
Public property ForegroundOpacity Gets the opacity of the foreground.
Public property ForegroundOpacityEmpty Determines whether any custom opacity is explicitly set for the foreground.
Public property Italic Determines whether the formatting is made explicitly italic.
Public property ItalicEmpty Determines whether the italic property is set.
Public property NumberSubstitution Gets the number substitution settings, which determines who numbers in text are displayed in different cultures. (Inherited from TextRunProperties.)
Public property TextDecorations Gets the decorations for the text. (Overrides TextRunProperties.TextDecorations.)
Public property TextDecorationsEmpty Determines whether the text decorations collection is empty.
Public property TextEffects Gets the text effects for the text. (Overrides TextRunProperties.TextEffects.)
Public property TextEffectsEmpty Determines whether the text effects collection is empty.
Public property Typeface Gets the typeface for the text. (Overrides TextRunProperties.Typeface.)
Public property TypefaceEmpty Determines whether the typeface is empty.
Public property TypographyProperties Gets the typography properties for the text run. (Inherited from TextRunProperties.)

Top

Methods

  Name Description
Public method BackgroundBrushSame Determines whether the background brush for this TextFormattingRunProperties is the same as the specified brush.
Public method ClearBackgroundBrush Gets a new TextFormattingRunProperties with all properties the same except for the background brush.
Public method ClearBackgroundOpacity Gets a new TextFormattingRunProperties with the BackgroundOpacity property cleared.
Public method ClearBold Gets a new TextFormattingRunProperties with the Bold property cleared.
Public method ClearCultureInfo Gets a new TextFormattingRunProperties with all properties the same except for the culture info.
Public method ClearFontHintingEmSize Gets a new TextFormattingRunProperties with all properties the same except for the font hinting size.
Public method ClearFontRenderingEmSize Gets a new TextFormattingRunProperties with all properties the same except for the rendering size.
Public method ClearForegroundBrush Gets a new TextFormattingRunProperties with all properties the same except for the foreground brush.
Public method ClearForegroundOpacity Gets a new TextFormattingRunProperties with the ForegroundOpacity property cleared.
Public method ClearItalic Gets a new TextFormattingRunProperties with all properties the same, but clears the Italic property.
Public method ClearTextDecorations Gets a new TextFormattingRunProperties with all properties the same except for the text decorations.
Public method ClearTextEffects Gets a new TextFormattingRunProperties with all properties the same except for the text effects.
Public method ClearTypeface Gets a new TextFormattingRunProperties with all properties the same except for the typeface.
Public methodStatic member CreateTextFormattingRunProperties() Initializes a new instance of TextFormattingRunProperties.
Public methodStatic member CreateTextFormattingRunProperties(Typeface, Double, Color) Initializes a new instance of TextFormattingRunProperties with the specified options.
Public methodStatic member CreateTextFormattingRunProperties(Brush, Brush, Typeface, Nullable<Double>, Nullable<Double>, TextDecorationCollection, TextEffectCollection, CultureInfo) Initializes a new instance of TextFormattingRunProperties with the specified options.
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 ForegroundBrushSame Determines whether the foreground brush for this TextFormattingRunProperties is the same as the specified.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetObjectData Serializes the TextFormattingRunProperties object using a XamlWriter.
Public method GetRealObject Gets the cached TextFormattingRunProperties object, or creates one if none exists.
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 SameSize Determines whether font sizes for two TextFormattingRunProperties objects are the same.
Public method SetBackground Gets a new TextFormattingRunProperties with the properties of this one but with the background set to the specified color.
Public method SetBackgroundBrush Gets a new TextFormattingRunProperties with the properties of this one but with the background brush set to the specified brush.
Public method SetBackgroundOpacity Gets a new TextFormattingRunProperties with the BackgroundOpacity property set to the specified opacity.
Public method SetBold Returns a new TextFormattingRunProperties with the properties of this one but with the Bold property set the specified bold value.
Public method SetCultureInfo Gets a new TextFormattingRunProperties with the properties of this one but with the culture set to the specified culture information.
Public method SetFontHintingEmSize Gets a new TextFormattingRunProperties with the properties of this one but with the font hinting size set to the specified size.
Public method SetFontRenderingEmSize Gets a new TextFormattingRunProperties with the properties of this one but with the font rendering size set to the specified size.
Public method SetForeground Gets a new TextFormattingRunProperties with the properties of this one but with the foreground set to the specified color
Public method SetForegroundBrush Gets a new TextFormattingRunProperties with the properties of this one but with the new foreground Brush set to the specified brush.
Public method SetForegroundOpacity Gets a new TextFormattingRunProperties with the properties of this one but with the ForegroundOpacity property set to the specified opacity.
Public method SetItalic Gets a new TextFormattingRunProperties with the properties of this one but with the Italic property set to the italic value.
Public method SetTextDecorations Gets a new TextFormattingRunProperties with the properties of this one but with the text decorations set to the specified text decorations.
Public method SetTextEffects Gets a new TextFormattingRunProperties with the properties of this one but with the text effects set to the specified text effects.
Public method SetTypeface Gets a new TextFormattingRunProperties with the properties of this one but with the typeface set to the specified typeface.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

This class is used to hold all information about the text formatting properties. Once created, it is immutable, and all modifications of the object return different objects. For each unique set of TextFormattingRunProperties there exists exactly one object. If a TextFormattingRunProperties has reference equality to another, their properties are identical. Conversely, if a TextFormattingRunProperties object has reference inequality, their properties are different.

Checking reference equality is the only way to determine whether two TextFormattingRunProperties are different. Checking the equality of each property of the object may indicate the two are identical, but that may or may not be the case.

A TextFormattingRunProperties instance may have empty properties. An empty property inherits the empty properties from some additional text. TextFormattingRunProperties has methods that determine whether a property is empty or not (PropertyNameEmpty) and that empty a property (PropertyNameClear).

All freezable fields of the TextFormattingRunProperties object are frozen on creation.

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.Formatting Namespace