ContentPosition Class
Represents a position within a DocumentModel.
- Inheritance:
- System.ObjectContentPosition
Remarks
For more information, see content manipulation examples.
Properties
Parent
Gets the parent that scopes the current ContentPosition.
Property Value
The parent that scopes the current ContentPosition.
Methods
InsertRange(ContentRange)
Inserts the content of the specified ContentRange at the current ContentPosition.
public ContentPosition InsertRange(ContentRange range)
Public Function InsertRange(range As ContentRange) As ContentPosition
Parameters
range
- ContentRange
The ContentRange which content should be inserted at the current ContentPosition.
Returns
A ContentPosition instance which points to a location just after the inserted content.
Remarks
For more information, see Insert Content example.
LoadFromClipboard(LoadOptions[])
Loads the content of the clipboard at the current ContentPosition using specified text format.
public void LoadFromClipboard(params LoadOptions[] listOfOptions)
Public Sub LoadFromClipboard(ParamArray listOfOptions As LoadOptions())
Parameters
listOfOptions
- LoadOptions[]
List of LoadOptions type derivations mapping clipboard text formats.
Remarks
Applications which load data from clipboard should try to load it using the richest text format it supports.
Following LoadOptions type derivations can be used: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions. If no LoadOptions is specified, content is loaded using first supported LoadOptions type derivation which successfully completed, trying in following order: RtfLoadOptions -> HtmlLoadOptions -> TxtLoadOptions.
Exceptions
- System.ArgumentException
LoadOptions type derivation supplied inside listOfOptions
is not supported for this operation. Use one of the supported derivations: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions
LoadFromClipboard(IEnumerable<LoadOptions>)
Loads the content of the clipboard at the current ContentPosition using specified text format.
public void LoadFromClipboard(IEnumerable<LoadOptions> listOfOptions)
Public Sub LoadFromClipboard(listOfOptions As IEnumerable(Of LoadOptions))
Parameters
listOfOptions
- System.Collections.Generic.IEnumerable<LoadOptions>
List of LoadOptions type derivations mapping clipboard text formats.
Remarks
Applications which load data from clipboard should try to load it using the richest text format it supports.
Following LoadOptions type derivations can be used: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions.
Exceptions
- System.ArgumentException
LoadOptions type derivation supplied inside listOfOptions
is not supported for this operation. Use one of the supported derivations: RtfLoadOptions, HtmlLoadOptions and TxtLoadOptions
LoadText(String)
Loads the specified text at the current ContentPosition.
public ContentPosition LoadText(string text)
Public Function LoadText(text As String) As ContentPosition
Parameters
text
- System.String
The text which should be loaded at the current ContentPosition.
Returns
A ContentPosition instance which points to a location just after the loaded text.
Remarks
For more information, see Insert Content example.
LoadText(String, CharacterFormat)
Loads the specified text with specific formatting at the current ContentPosition.
public ContentPosition LoadText(string text, CharacterFormat format)
Public Function LoadText(text As String, format As CharacterFormat) As ContentPosition
Parameters
text
- System.String
The text which should be loaded at the current ContentPosition.
format
- CharacterFormat
The formatting of the text which should be loaded at the current ContentPosition.
Returns
A ContentPosition instance which points to a location just after the loaded text.
Remarks
For more information, see Insert Content example.
LoadText(String, HtmlLoadOptions)
Loads the specified HTML text at the current ContentPosition.
public ContentPosition LoadText(string html, HtmlLoadOptions options)
Public Function LoadText(html As String, options As HtmlLoadOptions) As ContentPosition
Parameters
html
- System.String
The HTML text which should be loaded at the current ContentPosition.
options
- HtmlLoadOptions
The options used to define settings for load operation.
Returns
A ContentPosition instance which points to a location just after the loaded HTML text.
Remarks
For more information, see Word Editor in ASP.NET and Insert Content example.
LoadText(String, RtfLoadOptions)
Loads the specified RTF text at the current ContentPosition.
public ContentPosition LoadText(string text, RtfLoadOptions options)
Public Function LoadText(text As String, options As RtfLoadOptions) As ContentPosition
Parameters
text
- System.String
The RTF text which should be loaded at the current ContentPosition.
options
- RtfLoadOptions
The options used to define settings for load operation.
Returns
A ContentPosition instance which points to a location just after the loaded RTF text.
LoadText(String, TxtLoadOptions)
Loads the specified text at the current ContentPosition.
public ContentPosition LoadText(string text, TxtLoadOptions options)
Public Function LoadText(text As String, options As TxtLoadOptions) As ContentPosition
Parameters
text
- System.String
The text which should be loaded at the current ContentPosition.
options
- TxtLoadOptions
The options used to define settings for load operation.
Returns
A ContentPosition instance which points to a location just after the loaded text.
Remarks
For more information, see Insert Content example.