New to Telerik UI for WinFormsStart a free 30-day trial

Span

Class

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class Span : Inline, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Inheritance: objectDisposableObjectRadObjectDocumentElementInlineSpan...

Derived Classes: Break

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChanged

Inherited Members Inline.CopyContentFrom(DocumentElement)Inline.FieldStartInline.IsCopyableDocumentElement.GetStyleProperty(IStylePropertyDefinition)DocumentElement.GetStyleProperty(string)DocumentElement.EnumerateChildrenOfType<T>()DocumentElement.GetParentOfType<T>()DocumentElement.CreateLayoutBox()DocumentElement.CopyPropertiesFrom(DocumentElement)DocumentElement.CopyPropertiesFromStyle(StyleDefinition)DocumentElement.ExtractStyleFromProperties()DocumentElement.ExtractStyleFromLocalProperties()DocumentElement.InvalidateAssociatedBoxesArrange()DocumentElement.InvalidateAssociatedBoxesMeasure()DocumentElement.InvalidateAssociatedBoxesLayout()DocumentElement.GetAssociatedLayoutBoxes()DocumentElement.GetRootDocument()DocumentElement.CreateDeepCopy()DocumentElement.CreateShallowCopy()DocumentElement.GetPropertyValueSource(IStylePropertyDefinition)DocumentElement.ClearValue(IStylePropertyDefinition)DocumentElement.OnRemoved()DocumentElement.OnStyleChanging()DocumentElement.OnStyleChanged()DocumentElement.OnStylePropertyChanged(StylePropertyChangeEventArgs)DocumentElement.OnParentChanging()DocumentElement.OnParentChanged()DocumentElement.ChildIndexDocumentElement.HasStyleDocumentElement.StyleDocumentElement.StyleNameDocumentElement.FirstLayoutBoxDocumentElement.IsFirstLayoutBoxInitializedDocumentElement.DocumentElementsDocumentElement.ParentDocumentElement.ChildrenDocumentElement.PreviousSiblingDocumentElement.NextSiblingDocumentElement.StyleChangingDocumentElement.StyleChangedDocumentElement.StylePropertyChangedDocumentElement.ParentChangingDocumentElement.ParentChangedDocumentElement.PropertyValueChangedRadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.DisposeManagedResources()RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes a new instance of the Span class.

C#
public Span()

Initializes a new instance of the Span class. Creates a copy of an existing Span.

C#
public Span(Span originalSpan)
Parameters:originalSpanSpan

The original span.

Initializes a new instance of the Span class with applied text.

C#
public Span(string text)
Parameters:textstring

The text content of the span.

Fields

C#
public static readonly StylePropertyDefinition<BaselineAlignment?, SpanProperties> BaselineAlignmentProperty
C#
public static readonly StylePropertyDefinition<FlowDirection?, SpanProperties> FlowDirectionProperty
C#
public static readonly StylePropertyDefinition<FontFamily, SpanProperties> FontFamilyProperty
C#
public static readonly StylePropertyDefinition<double?, SpanProperties> FontSizeProperty
C#
public static readonly StylePropertyDefinition<FontStyle?, SpanProperties> FontStyleProperty
C#
public static readonly StylePropertyDefinition<FontWeight?, SpanProperties> FontWeightProperty
C#
public static readonly StylePropertyDefinition<Color?, SpanProperties> ForeColorProperty
C#
public static readonly StylePropertyDefinition<Color?, SpanProperties> HighlightColorProperty
C#
public static readonly StylePropertyDefinition<bool?, SpanProperties> StrikethroughProperty
C#
public static readonly StylePropertyDefinition<string, SpanProperties> TagProperty
C#
public static readonly StylePropertyDefinition<ThemeFontsEnum?, SpanProperties> ThemeFontFamilyProperty
C#
public static readonly StylePropertyDefinition<ThemeColorsEnum?, SpanProperties> ThemeForeColorProperty
C#
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeForeColorShadeProperty
C#
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeForeColorTintProperty
C#
public static readonly StylePropertyDefinition<ThemeColorsEnum?, SpanProperties> ThemeUnderlineColorProperty
C#
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeUnderlineColorShadeProperty
C#
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeUnderlineColorTintProperty
C#
public static readonly StylePropertyDefinition<Color?, SpanProperties> UnderlineColorProperty
C#
public static readonly StylePropertyDefinition<IUnderlineUIDecorationProvider, SpanProperties> UnderlineDecorationProperty

Properties

Gets or sets the baseline alignment.

C#
[XamlSerializable]
public BaselineAlignment BaselineAlignment { get; set; }
Property Value:

The baseline alignment.

Gets or sets the cursor type depending on the specific element inside the span.

C#
public override Cursor Cursor { get; set; }
Property Value:

An instance of Cursor determining the cursor representation.

Overrides: DocumentElement.Cursor

Gets or sets the flow direction.

C#
[XamlSerializable(FlowDirection.LeftToRight)]
public FlowDirection FlowDirection { get; set; }
Property Value:

The flow direction.

Gets or sets the font family of the content.

C#
[XamlSerializable]
public FontFamily FontFamily { get; set; }
Property Value:

The font family.

Gets or sets the size of the font. The value is in Device Independent Pixels.

C#
[XamlSerializable]
public double FontSize { get; set; }
Property Value:

The size of the font.

Gets or sets the font style.

C#
[XamlSerializable]
public FontStyle FontStyle { get; set; }
Property Value:

The font style.

Gets or sets the font weight.

C#
[XamlSerializable]
public FontWeight FontWeight { get; set; }
Property Value:

The font weight.

Gets or sets the fore color.

C#
[XamlSerializable]
public Color ForeColor { get; set; }
Property Value:

The color.

Gets or sets the color of the highlight.

C#
[XamlSerializable]
public Color HighlightColor { get; set; }
Property Value:

The color.

Gets or sets a value indicating whether this Span has a strike-through applied.

C#
[XamlSerializable]
public bool Strikethrough { get; set; }
Property Value:

true if strike-through is applied; otherwise, false.

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.

C#
[XamlSerializable("")]
public override string Tag { get; set; }

Overrides: DocumentElement.Tag

Gets or sets the text of the span.

C#
[XamlSerializable]
public string Text { get; set; }
Property Value:

The text.

Gets or sets the theme font family.

C#
[XamlSerializable(ThemeFontsEnum.none)]
public ThemeFontsEnum ThemeFontFamily { get; set; }
Property Value:

The theme font family.

Gets or sets the theme fore color.

C#
[XamlSerializable(ThemeColorsEnum.none)]
public ThemeColorsEnum ThemeForeColor { get; set; }
Property Value:

The color.

Gets or sets the theme fore color shade.

C#
[XamlSerializable]
public string ThemeForeColorShade { get; set; }
Property Value:

The theme fore color shade.

Gets or sets the theme fore color tint.

C#
[XamlSerializable]
public string ThemeForeColorTint { get; set; }
Property Value:

The theme fore color tint.

Gets or sets the theme color of the underline decoration.

C#
[XamlSerializable(ThemeColorsEnum.none)]
public ThemeColorsEnum ThemeUnderlineColor { get; set; }
Property Value:

The color.

Gets or sets the theme underline color shade.

C#
[XamlSerializable]
public string ThemeUnderlineColorShade { get; set; }
Property Value:

The theme underline color shade.

Gets or sets the theme underline color tint.

C#
[XamlSerializable]
public string ThemeUnderlineColorTint { get; set; }
Property Value:

The theme underline color tint.

Gets a value indicating whether this Span has underline applied to it.

C#
public bool Underline { get; }
Property Value:

true if the content is underlined; otherwise, false.

Gets or sets the color of the underline decoration.

C#
[XamlSerializable]
public Color UnderlineColor { get; set; }
Property Value:

The color.

Gets or sets the underline decoration.

C#
[XamlSerializable]
public IUnderlineUIDecorationProvider UnderlineDecoration { get; set; }
Property Value:

The underline decoration.

Methods

Associates the SpanLayoutBox with a new Span.

C#
public static bool AssociateBoxWithANewSpan(Span originalSpan, SpanLayoutBox spanLayoutBox)
Parameters:originalSpanSpan

The original span.

spanLayoutBoxSpanLayoutBox

The span layout box.

Returns:

bool

true, if LayoutBox instances have been moved.

Calculates the final size of the font depending on the BaselineAlignment value.

C#
public double CalculateFinalFontSize()
Returns:

double

The calculated font size.

Copies the content of a Span instance to the current object.

C#
protected override void CopyContentFromOverride(DocumentElement fromElement)
Parameters:fromElementDocumentElement

The Span to copy the content from.

Overrides: Inline.CopyContentFromOverride(DocumentElement)

Creates a new span which is a copy of the contents between two positions of the current Span instance.

C#
public override Inline CopyFromPositionToEndOfInline(DocumentPosition documentPosition, DocumentPosition endPosition)
Parameters:documentPositionDocumentPosition

The start position.

endPositionDocumentPosition

The end position.

Returns:

Inline

A new Span instance keeping the content between the specified positions.

Overrides: Inline.CopyFromPositionToEndOfInline(DocumentPosition, DocumentPosition)

Creates a new span which is a copy of the contents between the start of the current instance and a specified end position.

C#
public override Inline CopyFromStartOfInlineToEndPosition(DocumentPosition endPosition)
Parameters:endPositionDocumentPosition

The end position.

Returns:

Inline

A new Span instance keeping the contents between the start of the current instance and a specified end position.

Overrides: Inline.CopyFromStartOfInlineToEndPosition(DocumentPosition)

Copies the properties of a Span instance to the current object.

C#
protected override void CopyPropertiesFromOverride(DocumentElement fromElement)
Parameters:fromElementDocumentElement

The Span to copy the properties from.

Overrides: Inline.CopyPropertiesFromOverride(DocumentElement)

Creates a new SpanLayoutBox instance.

C#
public override LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
Parameters:documentCollectionDocumentStructureCollection

The document collection.

Returns:

LayoutBox

The new SpanLayoutBox instance.

Overrides: DocumentElement.CreateLayoutBox(DocumentStructureCollection)

Creates a new Span instance.

C#
protected override DocumentElement CreateNewElementInstance()
Returns:

DocumentElement

The new Span instance.

Overrides: DocumentElement.CreateNewElementInstance()

Determines whether a Span instance has the same style applied as the current one.

C#
public virtual bool HasSameStyle(Span other, bool compareFlowDirection = false, bool ignoreStyle = false)
Parameters:otherSpan

The other.

compareFlowDirectionbool

if set to true the FlowDirection is compared as well.

ignoreStylebool

if set to true the name of the style applied to the spans is not compared.

Returns:

bool

true if the current instance and the one passed as a parameter have the same style applied; otherwise, false.