Sdílet prostřednictvím


EditSpan Class

Definition

Important

This API is not CLS-compliant.

This class encapsulates one atomic edit operation. Add these to an EditArray then when you are ready call ApplyEdits().

public ref class EditSpan
[Windows::Foundation::Metadata::WebHostHidden]
class EditSpan
[System.CLSCompliant(false)]
public class EditSpan
public class EditSpan
[<System.CLSCompliant(false)>]
type EditSpan = class
type EditSpan = class
Public Class EditSpan
Inheritance
EditSpan
Attributes

Remarks

This class is used with the EditArray class to manage and apply edit operations. This class describes either a replacement or insertion operation, using a span and the new text. A deletion operation is a special case of a replacement where the replacement string is empty.

Replace Text

Set up a span that describes the text to replace and specify the text to replace with. When the edit operation is applied, the span is completely replaced by the new text.

Insert Text

Set up a span that describes the point of insertion but has no length; that is, the end point is the same as the start point. When the edit operation is applied, the new text is inserted at the specified point.

Delete Text

The delete operation is a special case of the replace operation. Set up a span that describes the text to delete and specify an empty string for the replacement text. When the edit operation is applied, the span is completely replaced by the new text, which in this case is an empty string. Since a span can describe multiple lines, whole lines can be deleted this way.

Notes to Inheritors

This class contains all the functionality needed to describe an edit operation. There is no need to derive from this class.

Notes to Callers

Instantiate this class with a TextSpan object and a string to describe a single edit operation.

Constructors

EditSpan(TextSpan, String)

Construct a new edit span object

Properties

LengthOfLastLine

Returns the length of the last line of text being inserted.

LineCount

Returns the number of lines in the new text being inserted.

Span

Determines the span to be replaced.

Text

Determines the replacement text.

Applies to