Class SpanLayoutBox
Represents a layout box for a span element in the Telerik document model.
Inherited Members
Namespace: Telerik.Windows.Documents.Layout
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public class SpanLayoutBox : InlineLayoutBox, INotifyPropertyChanged
Constructors
SpanLayoutBox(DocumentElement, DocumentStructureCollection)
Declaration
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection)
Parameters
DocumentElement
parentElement
|
DocumentStructureCollection
collection
|
SpanLayoutBox(DocumentElement, DocumentStructureCollection, Boolean)
Declaration
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, bool isFragment)
Parameters
DocumentElement
parentElement
|
DocumentStructureCollection
collection
|
System.Boolean
isFragment
|
SpanLayoutBox(DocumentElement, DocumentStructureCollection, String)
Declaration
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)
Parameters
DocumentElement
parentElement
|
DocumentStructureCollection
collection
|
System.String
text
|
Properties
AssociatedSpan
Gets or sets the associated span for the SpanLayoutBox.
Declaration
public Span AssociatedSpan { get; set; }
Property Value
Span
|
BaselineOffset
Gets the baseline offset of the span layout box, which indicates the distance from the top of the box to its baseline.
Declaration
public override float BaselineOffset { get; }
Property Value
System.Single
|
Overrides
CanCreateLayoutBoxesFromContent
Declaration
protected override bool CanCreateLayoutBoxesFromContent { get; }
Property Value
System.Boolean
|
Overrides
DesiredTextSize
Gets the desired size of the text within the SpanLayoutBox.
Declaration
public SizeF DesiredTextSize { get; }
Property Value
SizeF
|
HasWidthAtTheEndOfLine
Indicates whether the layout box has a defined width at the end of the line.
Declaration
public override bool HasWidthAtTheEndOfLine { get; }
Property Value
System.Boolean
|
Overrides
IsContainerBox
Indicates whether the span layout box is a container box.
Declaration
public override bool IsContainerBox { get; }
Property Value
System.Boolean
|
Overrides
IsDecimal
Gets a value indicating whether the current SpanLayoutBox represents a decimal number.
Declaration
public bool IsDecimal { get; set; }
Property Value
System.Boolean
|
IsParagraphSymbol
Gets a value indicating whether the current layout box represents a paragraph symbol.
Declaration
public bool IsParagraphSymbol { get; }
Property Value
System.Boolean
|
IsReadonly
Gets or sets a value indicating whether the layout box is in a read-only state.
Declaration
public override bool IsReadonly { get; }
Property Value
System.Boolean
|
Overrides
IsSplittable
Gets or sets a value indicating whether the span layout box can be split.
Declaration
public override bool IsSplittable { get; }
Property Value
System.Boolean
|
Overrides
PositionsCountInBox
Gets the number of positions within the layout box.
Declaration
public override int PositionsCountInBox { get; }
Property Value
System.Int32
|
Overrides
Text
Gets or sets the text content of the SpanLayoutBox.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
Methods
ContainsFormattingSymbol(String)
Determines whether the specified string contains a formatting symbol.
Declaration
public static bool ContainsFormattingSymbol(string text)
Parameters
System.String
text
The string to be checked for formatting symbols. |
Returns
System.Boolean
true if the string contains a formatting symbol; otherwise, false. |
CreateLayoutElement()
Creates a layout element from the current span layout box.
Declaration
public override LayoutElement CreateLayoutElement()
Returns
LayoutElement
A new layout element that represents the span layout box. |
Overrides
CreateNewFragment(Single, Boolean)
Creates a new fragment with the specified height and visibility status.
Declaration
public override LayoutBox CreateNewFragment(float availableWidth, bool isFirstBoxInLine)
Parameters
System.Single
availableWidth
The available width for the new fragment. |
System.Boolean
isFirstBoxInLine
A boolean indicating whether this is the first box in the current line |
Returns
LayoutBox
A new instance of the LayoutBox class representing the created fragment. |
Overrides
CreateSpanLayoutBox(DocumentElement, DocumentStructureCollection, String)
Creates a new instance of SpanLayoutBox for the specified document element using the provided document structure collection and text.
Declaration
public static SpanLayoutBox CreateSpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)
Parameters
DocumentElement
parentElement
The document element for which the span layout box is being created. |
DocumentStructureCollection
collection
A collection of document structures related to the layout. |
System.String
text
The text in the current SpanLayoutBox |
Returns
SpanLayoutBox
A new instance of SpanLayoutBox representing the layout of the specified document element. |
GetPositionHandler()
Gets the position of the layout box.
Declaration
public override PositionHandler GetPositionHandler()
Returns
PositionHandler
The position of the layout box as a PositionHandler object. |
Overrides
InvalidateTextMeasure()
Invalidates the text measurement for the current SpanLayoutBox, forcing a recalculation of the text layout measurements the next time they are needed.
Declaration
public void InvalidateTextMeasure()
IsWordStart()
Determines whether the current layout box marks the start of a word.
Declaration
public bool IsWordStart()
Returns
System.Boolean
|
MeasureOverride(SizeF)
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
SizeF
availableSize
|
Returns
SizeF
|
Overrides
MeasureTextOverride(SubStringPosition)
Declaration
protected virtual BoxMeasurementInfo MeasureTextOverride(SubStringPosition subStringPosition)
Parameters
Telerik.Windows.Documents.Core.TextMeasurer.SubStringPosition
subStringPosition
|
Returns
BoxMeasurementInfo
|
MergeWithNext(LayoutBox)
Merges the current span layout box with the next layout box if applicable.
Declaration
public override void MergeWithNext(LayoutBox nextSpanBox)
Parameters
LayoutBox
nextSpanBox
The layout box to merge with the current span layout box. |
Overrides
OnAssociateDocumentElementChanged()
Declaration
protected override void OnAssociateDocumentElementChanged()
Overrides
OnPropertyChanged(String)
Declaration
protected virtual void OnPropertyChanged(string propName)
Parameters
System.String
propName
|
SplitSpanByIndex(Int32, Boolean)
Splits the span at the specified index, creating two separate spans.
Declaration
public void SplitSpanByIndex(int splitIndex, bool isBefore)
Parameters
System.Int32
splitIndex
The index at which to split the span. |
System.Boolean
isBefore
A boolean value indicating whether to take the text before or after the index |
ToString()
Returns a string representation of the current instance of the SpanLayoutBox.
Declaration
public override string ToString()
Returns
System.String
A string that represents the current SpanLayoutBox object. |
Overrides
Update(String)
Updates the span layout box with the specified string value.
Declaration
public void Update(string text)
Parameters
System.String
text
The string value used to update the span layout box. |
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|