Back to Devexpress

DocumentPosition.ToInt() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentposition-69ee6da4.md

latest6.3 KB
Original Source

DocumentPosition.ToInt() Method

Returns an integer representation of the DocumentPosition object.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public int ToInt()
vb
Public Function ToInt As Integer

Returns

TypeDescription
Int32

An integer value.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the ToInt() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Notes.cs#L15

csharp
//Insert a footnote at the end of the 6th paragraph:
DocumentPosition footnotePosition = document.CreatePosition(document.Paragraphs[5].Range.End.ToInt() - 1);
document.Footnotes.Insert(footnotePosition);

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/NotesActions.cs#L15

csharp
//Insert a footnote at the end of the 6th paragraph:
DocumentPosition footnotePosition = document.CreatePosition(document.Paragraphs[5].Range.End.ToInt() - 1);
document.Footnotes.Insert(footnotePosition);

word-document-api-examples/CS/CodeExamples/ContentControlsActions.cs#L23

csharp
// Insert a form to enter a name:
var namePosition = document.CreatePosition(document.Paragraphs[0].Range.End.ToInt() - 1);
var nameControl = contentControls.InsertPlainTextControl(namePosition);

winforms-richedit-implement-t-sql-language-syntax-highlighting/CS/CustomSyntaxHighlightService.cs#L44

csharp
{
    tokens.Add(CreateToken(ranges[i].Start.ToInt(),ranges[i].End.ToInt(), Color.Red));
}

how-to-implement-t-sql-language-syntax-highlighting-by-creating-syntax-highlight-tokens/CS/DXRichEditSyntaxExample/MainWindow.xaml.cs#L65

csharp
{
    tokens.Add(CreateToken(ranges[i].Start.ToInt(), ranges[i].End.ToInt(), Color.Red));
}

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Notes.vb#L12

vb
'Insert a footnote at the end of the 6th paragraph:
Dim footnotePosition As DevExpress.XtraRichEdit.API.Native.DocumentPosition = document.CreatePosition(document.Paragraphs(CInt((5))).Range.[End].ToInt() - 1)
document.Footnotes.Insert(footnotePosition)

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/NotesActions.vb#L12

vb
'Insert a footnote at the end of the 6th paragraph:
Dim footnotePosition As DocumentPosition = document.CreatePosition(document.Paragraphs(5).Range.End.ToInt() - 1)
document.Footnotes.Insert(footnotePosition)

word-document-api-examples/VB/CodeExamples/NotesActions.vb#L29

vb
' Insert a footnote at the end of the sixth paragraph.
Dim footnotePosition As DevExpress.XtraRichEdit.API.Native.DocumentPosition = document.CreatePosition(document.Paragraphs(CInt((5))).Range.[End].ToInt() - 1)
document.Footnotes.Insert(footnotePosition)

winforms-richedit-implement-t-sql-language-syntax-highlighting/VB/CustomSyntaxHighlightService.vb#L41

vb
For i As Integer = 0 To ranges.Length - 1
    tokens.Add(CreateToken(ranges(i).Start.ToInt(), ranges(i).End.ToInt(), Color.Red))
Next

how-to-implement-t-sql-language-syntax-highlighting-by-creating-syntax-highlight-tokens/VB/DXRichEditSyntaxExample/MainWindow.xaml.vb#L62

vb
For i As Integer = 0 To ranges.Length - 1
    tokens.Add(CreateToken(ranges(i).Start.ToInt(), ranges(i).End.ToInt(), Color.Red))
Next

See Also

DocumentPosition Class

DocumentPosition Members

DevExpress.XtraRichEdit.API.Native Namespace