Class
SpanLayoutBox

Represents a layout box for a span element in the Telerik document model.

Definition

Namespace:Telerik.Windows.Documents.Layout

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class SpanLayoutBox : InlineLayoutBox, INotifyPropertyChanged

Inheritance: objectLayoutElementLayoutBoxInlineLayoutBoxSpanLayoutBox

Derived Classes: FormattingSymbolLayoutBox

Implements: INotifyPropertyChanged

Inherited Members InlineLayoutBox.Remove()InlineLayoutBox.LineInfoInlineLayoutBox.LineSegmentInfoInlineLayoutBox.IsRtlInlineLayoutBox.AssociatedInlineInlineLayoutBox.IsStartOfLineSegmentLayoutBox.currentYLayoutBox.AssociatedLayoutBoxPropertyLayoutBox.NodeLayoutBox.GetAssociatedLayoutBox(UIElement)LayoutBox.SetAssociatedLayoutBox(UIElement, LayoutBox)LayoutBox.OnElementStructureChanging()LayoutBox.OnElementStructureChanged()LayoutBox.CreateChildrenCollection(DocumentStructureCollection)LayoutBox.InvalidateMeasureUpToTheRoot()LayoutBox.InvalidateMeasureUpToTheRootStable()LayoutBox.InvalidateArrangeUpToTheRoot()LayoutBox.InvalidateLayoutAfterEdit()LayoutBox.ValidateChild(LayoutBox)LayoutBox.GetRootDocument()LayoutBox.CanGrowVerticallyOverride(float)LayoutBox.CanGrowVertically(float)LayoutBox.GetBoxDesiredGrow()LayoutBox.CreateNewFragment(LayoutBox)LayoutBox.InvalidateMeasure()LayoutBox.IsRemovedLayoutBox.IsFragmentLayoutBox.AssociatedDocumentElementLayoutBox.ChildLayoutBoxesLayoutBox.HasVisualRepresentationLayoutBox.IsFormattingSymbolLayoutBox.BoundsChildBoxesLayoutBox.IsFirstBoxLayoutBox.IsLastBoxLayoutBox.IsFirstChildLayoutBox.IsLastChildLayoutBox.IsValidPositionLayoutBox.ParentLayoutBox.ChildIndexLayoutBox.BoundingRectangleLayoutBox.ElementStructureChangingLayoutBox.ElementStructureChangedLayoutElement.EnsureChildrenCreated()LayoutElement.CreateChildren()LayoutElement.OnBitStateChanged(DocumentElementStates, bool, bool)LayoutElement.SetBitState(DocumentElementStates, bool)LayoutElement.ValidateParent(LayoutElement)LayoutElement.SetParent(LayoutElement, LayoutElement)LayoutElement.SetParentCore(LayoutElement)LayoutElement.IsInValidState(bool)LayoutElement.OnInvalidateMeasure()LayoutElement.InvalidateMeasure(bool)LayoutElement.InvalidateArrange()LayoutElement.OnInvalidateArrange()LayoutElement.InvalidateArrange(bool)LayoutElement.Arrange(RectangleF)LayoutElement.ArrangeCore(RectangleF)LayoutElement.ArrangeOverride(SizeF)LayoutElement.Measure(SizeF)LayoutElement.MeasureCore(SizeF)LayoutElement.OnChildDesiredSizeChanged(LayoutElement)LayoutElement.OnParentChanging()LayoutElement.OnParentChanged()LayoutElement.LayoutOffsetLayoutElement.IsTopContainerLayoutElement.LocalBoundingRectangleLayoutElement.ControlBoundingRectangleLayoutElement.ClippedControlBoundingRectangleLayoutElement.TotalTransformLayoutElement.ChildrenLayoutElement.BitStateLayoutElement.DesiredSizeLayoutElement.IsMeasureInProgressLayoutElement.BypassLayoutPoliciesLayoutElement.MeasureWithoutParentNotificationLayoutElement.SizeLayoutElement.IsArrangeValidLayoutElement.IsMeasureValidLayoutElement.TreeLevelLayoutElement.PreviousArrangeRectLayoutElement.AlignmentLayoutElement.AutoSizeLayoutElement.TransformLayoutElement.ParentChangingLayoutElement.ParentChanged

Constructors

SpanLayoutBox(DocumentElement, DocumentStructureCollection)

Declaration

cs-api-definition
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection)

Parameters

parentElement

DocumentElement

collection

DocumentStructureCollection

SpanLayoutBox(DocumentElement, DocumentStructureCollection, bool)

Declaration

cs-api-definition
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, bool isFragment)

Parameters

parentElement

DocumentElement

collection

DocumentStructureCollection

isFragment

bool

SpanLayoutBox(DocumentElement, DocumentStructureCollection, string)

Declaration

cs-api-definition
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)

Parameters

parentElement

DocumentElement

collection

DocumentStructureCollection

text

string

Properties

AssociatedSpan

Gets or sets the associated span for the SpanLayoutBox.

Declaration

cs-api-definition
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

cs-api-definition
public override float BaselineOffset { get; }

Property Value

float

Overrides InlineLayoutBox.BaselineOffset

CanCreateLayoutBoxesFromContent

Declaration

cs-api-definition
protected override bool CanCreateLayoutBoxesFromContent { get; }

Property Value

bool

Overrides LayoutBox.CanCreateLayoutBoxesFromContent

DesiredTextSize

Gets the desired size of the text within the SpanLayoutBox.

Declaration

cs-api-definition
public SizeF DesiredTextSize { get; }

Property Value

SizeF

HasWidthAtTheEndOfLine

Indicates whether the layout box has a defined width at the end of the line.

Declaration

cs-api-definition
public override bool HasWidthAtTheEndOfLine { get; }

Property Value

bool

Overrides InlineLayoutBox.HasWidthAtTheEndOfLine

IsContainerBox

Indicates whether the span layout box is a container box.

Declaration

cs-api-definition
public override bool IsContainerBox { get; }

Property Value

bool

Overrides InlineLayoutBox.IsContainerBox

IsDecimal

Gets a value indicating whether the current SpanLayoutBox represents a decimal number.

Declaration

cs-api-definition
public bool IsDecimal { get; set; }

Property Value

bool

IsParagraphSymbol

Gets a value indicating whether the current layout box represents a paragraph symbol.

Declaration

cs-api-definition
public bool IsParagraphSymbol { get; }

Property Value

bool

IsReadonly

Gets or sets a value indicating whether the layout box is in a read-only state.

Declaration

cs-api-definition
public override bool IsReadonly { get; }

Property Value

bool

Overrides InlineLayoutBox.IsReadonly

IsSplittable

Gets or sets a value indicating whether the span layout box can be split.

Declaration

cs-api-definition
public override bool IsSplittable { get; }

Property Value

bool

true if the span layout box is splitable; otherwise, false.

Overrides InlineLayoutBox.IsSplittable

PositionsCountInBox

Gets the number of positions within the layout box.

Declaration

cs-api-definition
public override int PositionsCountInBox { get; }

Property Value

int

Overrides InlineLayoutBox.PositionsCountInBox

Text

Gets or sets the text content of the SpanLayoutBox.

Declaration

cs-api-definition
public override string Text { get; set; }

Property Value

string

Overrides InlineLayoutBox.Text

Methods

ContainsFormattingSymbol(string)

Determines whether the specified string contains a formatting symbol.

Declaration

cs-api-definition
public static bool ContainsFormattingSymbol(string text)

Parameters

text

string

The string to be checked for formatting symbols.

Returns

bool

true if the string contains a formatting symbol; otherwise, false.

CreateLayoutElement()

Creates a layout element from the current span layout box.

Declaration

cs-api-definition
public override LayoutElement CreateLayoutElement()

Returns

LayoutElement

A new layout element that represents the span layout box.

Overrides LayoutBox.CreateLayoutElement()

CreateNewFragment(float, bool)

Creates a new fragment with the specified height and visibility status.

Declaration

cs-api-definition
public override LayoutBox CreateNewFragment(float availableWidth, bool isFirstBoxInLine)

Parameters

availableWidth

float

The available width for the new fragment.

isFirstBoxInLine

bool

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 InlineLayoutBox.CreateNewFragment(float, bool)

CreateSpanLayoutBox(DocumentElement, DocumentStructureCollection, string)

Creates a new instance of SpanLayoutBox for the specified document element using the provided document structure collection and text.

Declaration

cs-api-definition
public static SpanLayoutBox CreateSpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)

Parameters

parentElement

DocumentElement

The document element for which the span layout box is being created.

collection

DocumentStructureCollection

A collection of document structures related to the layout.

text

string

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

cs-api-definition
public override PositionHandler GetPositionHandler()

Returns

PositionHandler

The position of the layout box as a PositionHandler object.

Overrides InlineLayoutBox.GetPositionHandler()

InvalidateTextMeasure()

Invalidates the text measurement for the current SpanLayoutBox, forcing a recalculation of the text layout measurements the next time they are needed.

Declaration

cs-api-definition
public void InvalidateTextMeasure()

IsWordStart()

Determines whether the current layout box marks the start of a word.

Declaration

cs-api-definition
public bool IsWordStart()

Returns

bool

MeasureOverride(SizeF)

Measures the space required by the LayoutElement Used by the layout system.

Declaration

cs-api-definition
protected override SizeF MeasureOverride(SizeF availableSize)

Parameters

availableSize

SizeF

The size that is available to the LayoutElement. The available size can be infinity (to take the full size of the element)

Returns

SizeF

The minimum size required by the element to be completely visible. Cannot be infinity.

Overrides LayoutElement.MeasureOverride(SizeF)

Remarks

In this method call to the Measure method of each child must be made.

MeasureTextOverride(SubStringPosition)

Declaration

cs-api-definition
protected virtual BoxMeasurementInfo MeasureTextOverride(SubStringPosition subStringPosition = 0)

Parameters

subStringPosition

SubStringPosition

Returns

BoxMeasurementInfo

MergeWithNext(LayoutBox)

Merges the current span layout box with the next layout box if applicable.

Declaration

cs-api-definition
public override void MergeWithNext(LayoutBox nextSpanBox)

Parameters

nextSpanBox

LayoutBox

The layout box to merge with the current span layout box.

Overrides InlineLayoutBox.MergeWithNext(LayoutBox)

OnAssociateDocumentElementChanged()

Declaration

cs-api-definition
protected override void OnAssociateDocumentElementChanged()

Overrides LayoutBox.OnAssociateDocumentElementChanged()

OnPropertyChanged(string)

Declaration

cs-api-definition
protected virtual void OnPropertyChanged(string propName)

Parameters

propName

string

SplitSpanByIndex(int, bool)

Splits the span at the specified index, creating two separate spans.

Declaration

cs-api-definition
public void SplitSpanByIndex(int splitIndex, bool isBefore)

Parameters

splitIndex

int

The index at which to split the span.

isBefore

bool

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

cs-api-definition
public override string ToString()

Returns

string

A string that represents the current SpanLayoutBox object.

Overrides LayoutBox.ToString()

Update(string)

Updates the span layout box with the specified string value.

Declaration

cs-api-definition
public void Update(string text)

Parameters

text

string

The string value used to update the span layout box.

Events

PropertyChanged

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged