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 | |
---|---|---|
BackgroundBrush | Gets the background brush. (Overrides TextRunProperties.BackgroundBrush.) | |
BackgroundBrushEmpty | Determines whether the background brush is empty. | |
BackgroundOpacity | Returns the opacity of the background. | |
BackgroundOpacityEmpty | Determines whether any custom opacity is explicitly set for the background. | |
BaselineAlignment | Gets the baseline style for a text that is positioned on the vertical axis. (Inherited from TextRunProperties.) | |
Bold | Determines whether the formatting is made explicitly bold. | |
BoldEmpty | Determines whether the bold property is set. | |
CultureInfo | Gets the culture information. (Overrides TextRunProperties.CultureInfo.) | |
CultureInfoEmpty | Determines whether the culture info is empty. | |
FontHintingEmSize | Gets the font hinting size. (Overrides TextRunProperties.FontHintingEmSize.) | |
FontHintingEmSizeEmpty | Determines whether the font hinting size is empty. | |
FontRenderingEmSize | Gets the font rendering size. (Overrides TextRunProperties.FontRenderingEmSize.) | |
FontRenderingEmSizeEmpty | Determines whether the size is empty. | |
ForegroundBrush | Gets the foreground brush. (Overrides TextRunProperties.ForegroundBrush.) | |
ForegroundBrushEmpty | Determines whether the foreground brush is empty. | |
ForegroundOpacity | Gets the opacity of the foreground. | |
ForegroundOpacityEmpty | Determines whether any custom opacity is explicitly set for the foreground. | |
Italic | Determines whether the formatting is made explicitly italic. | |
ItalicEmpty | Determines whether the italic property is set. | |
NumberSubstitution | Gets the number substitution settings, which determines who numbers in text are displayed in different cultures. (Inherited from TextRunProperties.) | |
TextDecorations | Gets the decorations for the text. (Overrides TextRunProperties.TextDecorations.) | |
TextDecorationsEmpty | Determines whether the text decorations collection is empty. | |
TextEffects | Gets the text effects for the text. (Overrides TextRunProperties.TextEffects.) | |
TextEffectsEmpty | Determines whether the text effects collection is empty. | |
Typeface | Gets the typeface for the text. (Overrides TextRunProperties.Typeface.) | |
TypefaceEmpty | Determines whether the typeface is empty. | |
TypographyProperties | Gets the typography properties for the text run. (Inherited from TextRunProperties.) |
Top
Methods
Name | Description | |
---|---|---|
BackgroundBrushSame | Determines whether the background brush for this TextFormattingRunProperties is the same as the specified brush. | |
ClearBackgroundBrush | Gets a new TextFormattingRunProperties with all properties the same except for the background brush. | |
ClearBackgroundOpacity | Gets a new TextFormattingRunProperties with the BackgroundOpacity property cleared. | |
ClearBold | Gets a new TextFormattingRunProperties with the Bold property cleared. | |
ClearCultureInfo | Gets a new TextFormattingRunProperties with all properties the same except for the culture info. | |
ClearFontHintingEmSize | Gets a new TextFormattingRunProperties with all properties the same except for the font hinting size. | |
ClearFontRenderingEmSize | Gets a new TextFormattingRunProperties with all properties the same except for the rendering size. | |
ClearForegroundBrush | Gets a new TextFormattingRunProperties with all properties the same except for the foreground brush. | |
ClearForegroundOpacity | Gets a new TextFormattingRunProperties with the ForegroundOpacity property cleared. | |
ClearItalic | Gets a new TextFormattingRunProperties with all properties the same, but clears the Italic property. | |
ClearTextDecorations | Gets a new TextFormattingRunProperties with all properties the same except for the text decorations. | |
ClearTextEffects | Gets a new TextFormattingRunProperties with all properties the same except for the text effects. | |
ClearTypeface | Gets a new TextFormattingRunProperties with all properties the same except for the typeface. | |
CreateTextFormattingRunProperties() | Initializes a new instance of TextFormattingRunProperties. | |
CreateTextFormattingRunProperties(Typeface, Double, Color) | Initializes a new instance of TextFormattingRunProperties with the specified options. | |
CreateTextFormattingRunProperties(Brush, Brush, Typeface, Nullable<Double>, Nullable<Double>, TextDecorationCollection, TextEffectCollection, CultureInfo) | Initializes a new instance of TextFormattingRunProperties with the specified options. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
ForegroundBrushSame | Determines whether the foreground brush for this TextFormattingRunProperties is the same as the specified. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetObjectData | Serializes the TextFormattingRunProperties object using a XamlWriter. | |
GetRealObject | Gets the cached TextFormattingRunProperties object, or creates one if none exists. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SameSize | Determines whether font sizes for two TextFormattingRunProperties objects are the same. | |
SetBackground | Gets a new TextFormattingRunProperties with the properties of this one but with the background set to the specified color. | |
SetBackgroundBrush | Gets a new TextFormattingRunProperties with the properties of this one but with the background brush set to the specified brush. | |
SetBackgroundOpacity | Gets a new TextFormattingRunProperties with the BackgroundOpacity property set to the specified opacity. | |
SetBold | Returns a new TextFormattingRunProperties with the properties of this one but with the Bold property set the specified bold value. | |
SetCultureInfo | Gets a new TextFormattingRunProperties with the properties of this one but with the culture set to the specified culture information. | |
SetFontHintingEmSize | Gets a new TextFormattingRunProperties with the properties of this one but with the font hinting size set to the specified size. | |
SetFontRenderingEmSize | Gets a new TextFormattingRunProperties with the properties of this one but with the font rendering size set to the specified size. | |
SetForeground | Gets a new TextFormattingRunProperties with the properties of this one but with the foreground set to the specified color | |
SetForegroundBrush | Gets a new TextFormattingRunProperties with the properties of this one but with the new foreground Brush set to the specified brush. | |
SetForegroundOpacity | Gets a new TextFormattingRunProperties with the properties of this one but with the ForegroundOpacity property set to the specified opacity. | |
SetItalic | Gets a new TextFormattingRunProperties with the properties of this one but with the Italic property set to the italic value. | |
SetTextDecorations | Gets a new TextFormattingRunProperties with the properties of this one but with the text decorations set to the specified text decorations. | |
SetTextEffects | Gets a new TextFormattingRunProperties with the properties of this one but with the text effects set to the specified text effects. | |
SetTypeface | Gets a new TextFormattingRunProperties with the properties of this one but with the typeface set to the specified typeface. | |
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.