TextFormattingRunProperties 类

保存文本格式属性信息。 此类从抽象 TextRunProperties 类派生。

继承层次结构

Object
  TextRunProperties
    Microsoft.VisualStudio.Text.Formatting.TextFormattingRunProperties

命名空间:  Microsoft.VisualStudio.Text.Formatting
程序集:  Microsoft.VisualStudio.Text.UI.Wpf(在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)

语法

声明
<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

TextFormattingRunProperties 类型公开以下成员。

属性

  名称 说明
公共属性 BackgroundBrush 获取背景画笔。 (重写 TextRunProperties.BackgroundBrush。)
公共属性 BackgroundBrushEmpty 确定背景画笔是否为空。
公共属性 BackgroundOpacity 返回背景的不透明度。
公共属性 BackgroundOpacityEmpty 确定任何自定义不透明背景是否为显式地设置。
公共属性 BaselineAlignment 获取位于垂直轴上的文本的基线样式。 (继承自 TextRunProperties。)
公共属性 Bold 确定格式是否显式启用粗体。
公共属性 BoldEmpty 确定粗体属性是否设置为。
公共属性 CultureInfo 获取区域性信息。 (重写 TextRunProperties.CultureInfo。)
公共属性 CultureInfoEmpty 确定区域性信息是否为空。
公共属性 FontHintingEmSize 获取字体提示大小。 (重写 TextRunProperties.FontHintingEmSize。)
公共属性 FontHintingEmSizeEmpty 确定字体提示大小是否为空。
公共属性 FontRenderingEmSize 获取字体呈现大小。 (重写 TextRunProperties.FontRenderingEmSize。)
公共属性 FontRenderingEmSizeEmpty 确定大小是否为空。
公共属性 ForegroundBrush 获取前景画笔。 (重写 TextRunProperties.ForegroundBrush。)
公共属性 ForegroundBrushEmpty 确定前景画笔是否为空。
公共属性 ForegroundOpacity 获取一个前景的不透明度。
公共属性 ForegroundOpacityEmpty 确定任何自定义不透明是否为前台显式地设置。
公共属性 Italic 确定格式是否显式使斜体。
公共属性 ItalicEmpty 确定该斜体的属性是否设置为。
公共属性 NumberSubstitution 获取数字替换设置,这些设置确定文本中的哪些数字是用其他区域性显示的。 (继承自 TextRunProperties。)
公共属性 TextDecorations 获取文本的修饰。 (重写 TextRunProperties.TextDecorations。)
公共属性 TextDecorationsEmpty 确定文本修饰集合是否为空。
公共属性 TextEffects 获取文本的文本效果。 (重写 TextRunProperties.TextEffects。)
公共属性 TextEffectsEmpty 确定文本效果集合是否为空。
公共属性 Typeface 获取文本的字样。 (重写 TextRunProperties.Typeface。)
公共属性 TypefaceEmpty 确定字样是否为空。
公共属性 TypographyProperties 获取文本运行的版式属性。 (继承自 TextRunProperties。)

页首

方法

  名称 说明
公共方法 BackgroundBrushSame 确定此 TextFormattingRunProperties 的背景画笔是否与指定的画笔相同。
公共方法 ClearBackgroundBrush 获取除了背景画笔外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearBackgroundOpacity 获取与 BackgroundOpacity 属性的新 TextFormattingRunProperties 清除。
公共方法 ClearBold 获取与 Bold 属性的新 TextFormattingRunProperties 清除。
公共方法 ClearCultureInfo 获取除了区域性信息外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearFontHintingEmSize 获取除了字体提示大小外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearFontRenderingEmSize 获取除了呈现大小外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearForegroundBrush 获取除了前景画笔外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearForegroundOpacity 获取与 ForegroundOpacity 属性的新 TextFormattingRunProperties 清除。
公共方法 ClearItalic 获取包含所有属性的新 TextFormattingRunProperties 相同,但是,清除 Italic 属性。
公共方法 ClearTextDecorations 获取除了文本修饰外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearTextEffects 获取除了文本效果外、所有属性都相同的新 TextFormattingRunProperties。
公共方法 ClearTypeface 获取除了字样外、所有属性都相同的新 TextFormattingRunProperties。
公共方法静态成员 CreateTextFormattingRunProperties() 初始化 TextFormattingRunProperties 的新实例。
公共方法静态成员 CreateTextFormattingRunProperties(Typeface, Double, Color) 使用指定选项初始化 TextFormattingRunProperties 的新实例。
公共方法静态成员 CreateTextFormattingRunProperties(Brush, Brush, Typeface, Nullable<Double>, Nullable<Double>, TextDecorationCollection, TextEffectCollection, CultureInfo) 使用指定选项初始化 TextFormattingRunProperties 的新实例。
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
公共方法 ForegroundBrushSame 确定此 TextFormattingRunProperties 的前景画笔是否与指定的。
公共方法 GetHashCode 作为默认哈希函数。 (继承自 Object。)
公共方法 GetObjectData 使用 XamlWriter,序列化 TextFormattingRunProperties 对象。
公共方法 GetRealObject ,如果不存在任何继承,获取缓存的 TextFormattingRunProperties 对象或创建一个。
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 SameSize 确定两 TextFormattingRunProperties 对象的字号是否相同。
公共方法 SetBackground 获取新 TextFormattingRunProperties 与属性的一个,但是背景设置为指定的颜色。
公共方法 SetBackgroundBrush 获取具有属性的新 TextFormattingRunProperties 这个,但是背景画笔设置为将向指定的画笔。
公共方法 SetBackgroundOpacity 获取与 BackgroundOpacity 属性的新 TextFormattingRunProperties 设置为指定的不透明度。
公共方法 SetBold 返回与属性的新 TextFormattingRunProperties 这个,但与 Bold 属性将指定的粗体值。
公共方法 SetCultureInfo 获取新 TextFormattingRunProperties 与属性的一个,但是区域性设置为指定区域性信息。
公共方法 SetFontHintingEmSize 获取新 TextFormattingRunProperties 与属性的一个,但与字体提示大小设置为指定的范围。
公共方法 SetFontRenderingEmSize 获取新 TextFormattingRunProperties 与属性的一个,但与字体呈现大小设置为指定的范围。
公共方法 SetForeground 获取新 TextFormattingRunProperties 与属性的一个,但是前景设置为指定的颜色
公共方法 SetForegroundBrush 获取新 TextFormattingRunProperties 与属性的一个,但与新的前景 Brush 设置为将向指定的画笔。
公共方法 SetForegroundOpacity 获取新 TextFormattingRunProperties 与属性的一个,但与 ForegroundOpacity 属性设置为指定的不透明度。
公共方法 SetItalic 获取新 TextFormattingRunProperties 与属性的一个,但与 Italic 属性设置为斜体的值。
公共方法 SetTextDecorations 获取新 TextFormattingRunProperties 与属性的一个,但是文本修饰设置为指定文本修饰。
公共方法 SetTextEffects 获取新 TextFormattingRunProperties 与属性的一个,但是文本效果设置为指定的文本效果。
公共方法 SetTypeface 获取新 TextFormattingRunProperties 与属性的一个,但是字样设置为指定的字样。
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

备注

此类用于保存有关文本格式属性的所有信息。 一旦创建,它是不可变的,因此,对象的所有修改返回不同的对象。 对于每一组其中 TextFormattingRunProperties 正确显示一个对象。 如果 TextFormattingRunProperties 具有引用相等性到另一个,其属性相同。 相反,因此,如果 TextFormattingRunProperties 对象具有引用不相等,其属性是不同的。

检查引用相等性是唯一一种可以确定两 TextFormattingRunProperties 是否不同。 检查对象的每个属性的相等可能指示两个相同的,但是,这可能存在也可能不区分大小写。

TextFormattingRunProperties 实例能有空的属性。 一个空的属性继承一些其他文本的空的属性。 TextFormattingRunProperties 具有定位方法属性是否为空或非 (空PropertyName),并清空属性 (PropertyName清除)。

TextFormattingRunProperties 对象的所有 freezable 字段在创建冻结。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.VisualStudio.Text.Formatting 命名空间