[]
        
(Showing Draft Content)

C1.Win.C1Editor.C1Editor.CreateRange

CreateRange Method

CreateRange()

Creates a text range.

Declaration
public C1TextRange CreateRange()
Returns
Type Description
C1TextRange

A new text range.

CreateRange(int, int)

Creates a range that begins with the specified starting character and continues through the specified length of characters.

Declaration
public C1TextRange CreateRange(int start, int length)
Parameters
Type Name Description
int start

The start position

int length

The length of the range

Returns
Type Description
C1TextRange

The text range.

Examples

This code demonstrates the CreateRange(int, int) method.

 private void button1_Click(object sender, EventArgs e)
{
c1Editor1.LoadXml("<html><head><title>Document</title></head><body><p>12<span>3</span>456</p></body></html>", new Uri("c:\"));
C1TextRange r = c1Editor1.CreateRange(1, 3);
Console.WriteLine(r.Text);
// Output: 234
}

CreateRange(XmlNode)

Creates a range on the specified XmlNode.

Declaration
public C1TextRange CreateRange(XmlNode node)
Parameters
Type Name Description
XmlNode node

The target node.

Returns
Type Description
C1TextRange

The text range.

CreateRange(C1TextPointer, C1TextPointer)

Creates a range between the specified start and end C1TextPointer.

Declaration
public C1TextRange CreateRange(C1TextPointer start, C1TextPointer end)
Parameters
Type Name Description
C1TextPointer start

The start pointer.

C1TextPointer end

The end pointer.

Returns
Type Description
C1TextRange

The text range.

Examples

This code demonstrates the CreateRange(int, int) method.

 private void button1_Click(object sender, EventArgs e)
{
c1Editor1.LoadXml("<html><head><title>Document</title></head><body><p>12<span>3</span>456</p></body></html>", new Uri("c:\"));
C1TextRange r = c1Editor1.CreateRange(1, 3);
Console.WriteLine(r.Text);
// Output: 234
}