ClassSpan
Represents a span of text within a document, allowing for text formatting and structuring.
Definition
Namespace:Telerik.Windows.Documents.Model
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class Span : Inline
Inheritance: objectDocumentElementInlineSpan
Derived Classes:
Inherited Members
Constructors
Span(Span)
Declaration
public Span(Span originalSpan)
Parameters
originalSpan
The original span.
Span(string)
Initializes a new instance of the Span class with applied text.
Declaration
public Span(string text)
Parameters
text
The text content of the span.
Fields
BaselineAlignmentProperty
Declaration
public static readonly StylePropertyDefinition<BaselineAlignment?, SpanProperties> BaselineAlignmentProperty
Field Value
FlowDirectionProperty
Declaration
public static readonly StylePropertyDefinition<FlowDirection?, SpanProperties> FlowDirectionProperty
Field Value
StylePropertyDefinition<FlowDirection?, SpanProperties>
FontFamilyProperty
Declaration
public static readonly StylePropertyDefinition<FontFamily, SpanProperties> FontFamilyProperty
Field Value
StylePropertyDefinition<FontFamily, SpanProperties>
FontSizeProperty
Declaration
public static readonly StylePropertyDefinition<double?, SpanProperties> FontSizeProperty
Field Value
FontStyleProperty
Declaration
public static readonly StylePropertyDefinition<FontStyle?, SpanProperties> FontStyleProperty
Field Value
StylePropertyDefinition<FontStyle?, SpanProperties>
FontWeightProperty
Declaration
public static readonly StylePropertyDefinition<FontWeight?, SpanProperties> FontWeightProperty
Field Value
StylePropertyDefinition<FontWeight?, SpanProperties>
ForeColorProperty
Declaration
public static readonly StylePropertyDefinition<Color?, SpanProperties> ForeColorProperty
Field Value
StylePropertyDefinition<Color?, SpanProperties>
HighlightColorProperty
Declaration
public static readonly StylePropertyDefinition<Color?, SpanProperties> HighlightColorProperty
Field Value
StylePropertyDefinition<Color?, SpanProperties>
StrikethroughProperty
Declaration
public static readonly StylePropertyDefinition<bool?, SpanProperties> StrikethroughProperty
Field Value
TagProperty
Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> TagProperty
Field Value
ThemeFontFamilyProperty
Declaration
public static readonly StylePropertyDefinition<ThemeFontsEnum?, SpanProperties> ThemeFontFamilyProperty
Field Value
ThemeForeColorProperty
Declaration
public static readonly StylePropertyDefinition<ThemeColorsEnum?, SpanProperties> ThemeForeColorProperty
Field Value
ThemeForeColorShadeProperty
Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeForeColorShadeProperty
Field Value
ThemeForeColorTintProperty
Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeForeColorTintProperty
Field Value
ThemeUnderlineColorProperty
Declaration
public static readonly StylePropertyDefinition<ThemeColorsEnum?, SpanProperties> ThemeUnderlineColorProperty
Field Value
ThemeUnderlineColorShadeProperty
Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeUnderlineColorShadeProperty
Field Value
ThemeUnderlineColorTintProperty
Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeUnderlineColorTintProperty
Field Value
UnderlineColorProperty
Declaration
public static readonly StylePropertyDefinition<Color?, SpanProperties> UnderlineColorProperty
Field Value
StylePropertyDefinition<Color?, SpanProperties>
UnderlineDecorationProperty
Declaration
public static readonly StylePropertyDefinition<IUnderlineUIDecorationProvider, SpanProperties> UnderlineDecorationProperty
Field Value
StylePropertyDefinition<IUnderlineUIDecorationProvider, SpanProperties>
Properties
BaselineAlignment
Gets or sets the baseline alignment.
Declaration
[XamlSerializable]
public BaselineAlignment BaselineAlignment { get; set; }
Property Value
The baseline alignment.
Cursor
Gets or sets the cursor type depending on the specific element inside the span.
Declaration
public override Cursor Cursor { get; set; }
Property Value
Cursor
An instance of Cursor determining the cursor representation.
Overrides
FlowDirection
Gets or sets the flow direction.
Declaration
[XamlSerializable]
public FlowDirection FlowDirection { get; set; }
Property Value
FlowDirection
The flow direction.
FontFamily
Gets or sets the font family of the content.
Declaration
[XamlSerializable]
public FontFamily FontFamily { get; set; }
Property Value
FontFamily
The font family.
FontSize
Gets or sets the size of the font. The value is in Device Independent Pixels.
Declaration
[XamlSerializable]
public double FontSize { get; set; }
Property Value
The size of the font.
FontStyle
Gets or sets the font style.
Declaration
[XamlSerializable]
public FontStyle FontStyle { get; set; }
Property Value
FontStyle
The font style.
FontWeight
Gets or sets the font weight.
Declaration
[XamlSerializable]
public FontWeight FontWeight { get; set; }
Property Value
FontWeight
The font weight.
ForeColor
Gets or sets the fore color.
Declaration
[XamlSerializable]
public Color ForeColor { get; set; }
Property Value
Color
The color.
HighlightColor
Gets or sets the color of the highlight.
Declaration
[XamlSerializable]
public Color HighlightColor { get; set; }
Property Value
Color
The color.
Strikethrough
Gets or sets a value indicating whether this Span has a strike-through applied.
Declaration
[XamlSerializable]
public bool Strikethrough { get; set; }
Property Value
true if strike-through is applied; otherwise, false.
Tag
String property that allows developers to attach custom data to the DocumentElement. The value of this property will be copied to DocumentElements created out of this DocumentElement during editing.
Declaration
[XamlSerializable("")]
public override string Tag { get; set; }
Property Value
Overrides
Text
Gets or sets the text of the span.
Declaration
[XamlSerializable]
public string Text { get; set; }
Property Value
The text.
ThemeFontFamily
Gets or sets the theme font family.
Declaration
[XamlSerializable(ThemeFontsEnum.none)]
public ThemeFontsEnum ThemeFontFamily { get; set; }
Property Value
The theme font family.
ThemeForeColor
Gets or sets the theme fore color.
Declaration
[XamlSerializable(ThemeColorsEnum.none)]
public ThemeColorsEnum ThemeForeColor { get; set; }
Property Value
The color.
ThemeForeColorShade
Gets or sets the theme fore color shade.
Declaration
[XamlSerializable]
public string ThemeForeColorShade { get; set; }
Property Value
The theme fore color shade.
ThemeForeColorTint
Gets or sets the theme fore color tint.
Declaration
[XamlSerializable]
public string ThemeForeColorTint { get; set; }
Property Value
The theme fore color tint.
ThemeUnderlineColor
Gets or sets the theme color of the underline decoration.
Declaration
[XamlSerializable(ThemeColorsEnum.none)]
public ThemeColorsEnum ThemeUnderlineColor { get; set; }
Property Value
The color.
ThemeUnderlineColorShade
Gets or sets the theme underline color shade.
Declaration
[XamlSerializable]
public string ThemeUnderlineColorShade { get; set; }
Property Value
The theme underline color shade.
ThemeUnderlineColorTint
Gets or sets the theme underline color tint.
Declaration
[XamlSerializable]
public string ThemeUnderlineColorTint { get; set; }
Property Value
The theme underline color tint.
Underline
Gets a value indicating whether this Span has underline applied to it.
Declaration
public bool Underline { get; }
Property Value
true if the content is underlined; otherwise, false.
UnderlineColor
Gets or sets the color of the underline decoration.
Declaration
[XamlSerializable]
public Color UnderlineColor { get; set; }
Property Value
Color
The color.
UnderlineDecoration
Gets or sets the underline decoration.
Declaration
[XamlSerializable]
public IUnderlineUIDecorationProvider UnderlineDecoration { get; set; }
Property Value
IUnderlineUIDecorationProvider
The underline decoration.
Methods
AssociateBoxWithANewSpan(Span, SpanLayoutBox)
Associates the SpanLayoutBox with a new Span.
Declaration
public static bool AssociateBoxWithANewSpan(Span originalSpan, SpanLayoutBox spanLayoutBox)
Parameters
originalSpan
The original span.
spanLayoutBox
The span layout box.
Returns
true, if LayoutBox instances have been moved.
CalculateFinalFontSize()
Calculates the final size of the font depending on the BaselineAlignment value.
Declaration
public double CalculateFinalFontSize()
Returns
The calculated font size.
CopyContentFromOverride(DocumentElement)
Copies the content of a Span instance to the current object.
Declaration
protected override void CopyContentFromOverride(DocumentElement fromElement)
Parameters
fromElement
The Span to copy the content from.
Overrides
CopyFromPositionToEndOfInline(DocumentPosition, DocumentPosition)
Creates a new span which is a copy of the contents between two positions of the current Span instance.
Declaration
public override Inline CopyFromPositionToEndOfInline(DocumentPosition documentPosition, DocumentPosition endPosition)
Parameters
documentPosition
The start position.
endPosition
The end position.
Returns
A new Span instance keeping the content between the specified positions.
Overrides
CopyFromStartOfInlineToEndPosition(DocumentPosition)
Creates a new span which is a copy of the contents between the start of the current instance and a specified end position.
Declaration
public override Inline CopyFromStartOfInlineToEndPosition(DocumentPosition endPosition)
Parameters
endPosition
The end position.
Returns
A new Span instance keeping the contents between the start of the current instance and a specified end position.
Overrides
CopyPropertiesFromOverride(DocumentElement)
Copies the properties of a Span instance to the current object.
Declaration
protected override void CopyPropertiesFromOverride(DocumentElement fromElement)
Parameters
fromElement
The Span to copy the properties from.
Overrides
CreateLayoutBox(DocumentStructureCollection)
Creates a new SpanLayoutBox instance.
Declaration
public override LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
Parameters
documentCollection
The document collection.
Returns
The new SpanLayoutBox instance.
Overrides
CreateNewElementInstance()
Creates a new Span instance.
Declaration
protected override DocumentElement CreateNewElementInstance()
Returns
The new Span instance.
Overrides
HasSameStyle(Span, bool, bool)
Determines whether a Span instance has the same style applied as the current one.
Declaration
public virtual bool HasSameStyle(Span other, bool compareFlowDirection = false, bool ignoreStyle = false)
Parameters
other
The other.
compareFlowDirection
if set to true the FlowDirection is compared as well.
ignoreStyle
if set to true the name of the style applied to the spans is not compared.
Returns
true if the current instance and the one passed as a parameter have the same style applied; otherwise, false.