Class DocumentSelection
Represents a selection in a Rad
Inheritance
Inherited Members
Namespace: Telerik.WinForms.Documents.Selection
Assembly: Telerik.WinControls.RichTextEditor.dll
Syntax
public class DocumentSelection
Constructors
DocumentSelection(RadDocument)
Creates an instance of the Document
Declaration
public DocumentSelection(RadDocument document)
Parameters
Rad A Rad |
Properties
CanGetSelectedBoxes
Gets a value indicating whether the selected boxes can be enumerated correctly.
Declaration
public bool CanGetSelectedBoxes { get; }
Property Value
System.
|
IsEmpty
Gets a value determining whether the selection is empty.
Declaration
public bool IsEmpty { get; }
Property Value
System.
|
Ranges
Gets a collection of all Selection
Declaration
public SelectionRangeCollection Ranges { get; }
Property Value
Methods
AddDocumentElementToSelection(DocumentElement)
Adds a specified document element to the existing selection.
Declaration
public void AddDocumentElementToSelection(DocumentElement documentElement)
Parameters
Document The document element that should be added to the selection. |
AddParagraphToSelection(Paragraph)
Adds a paragraph to the existing selection.
Declaration
public void AddParagraphToSelection(Paragraph paragraph)
Parameters
Paragraph
paragraph
The paragraph that should be added to the selection. |
AddSelectionEnd(DocumentPosition)
Finishes the started Selectionposition
.
This method finishes a range started using Add
Declaration
public void AddSelectionEnd(DocumentPosition position)
Parameters
Document The end position. |
AddSelectionStart(DocumentPosition)
Begins a new Selectionposition
.
This method starts the creation of a range, which should be finished with Add
Declaration
public void AddSelectionStart(DocumentPosition position)
Parameters
Document The start position. |
AddTableCellToSelection(TableCell)
Adds a table cell to the existing selection.
Declaration
public void AddTableCellToSelection(TableCell tableCell)
Parameters
Table The cell that should be added to the selection. |
AnchorSelectionPositions()
Declaration
public void AnchorSelectionPositions()
BeginUpdate()
Declaration
public void BeginUpdate()
Clear()
Clears the selection.
Declaration
public void Clear()
ContainsAnnotationMarkersOfType<T>()
Determines whether the selection contains annotation markers of type T.
Declaration
public bool ContainsAnnotationMarkersOfType<T>()
where T : AnnotationMarkerBase
Returns
System.
|
Type Parameters
T
|
CopySelectedDocumentElements(Boolean)
Copies all selected document elements to a Document
Declaration
public DocumentFragment CopySelectedDocumentElements(bool expandPartialRevisionRanges = false)
Parameters
System. Determines whether the partially selected revision ranges should be preserved by creating pairs for them. |
Returns
Document A Document |
CopySelectedDocumentElements(SelectionRange)
Declaration
public static DocumentFragment CopySelectedDocumentElements(SelectionRange range)
Parameters
Selection
|
Returns
CreateDocumentFromSelection(Boolean)
Creates a new document from the selected elements.
Declaration
public RadDocument CreateDocumentFromSelection(bool replaceFieldsWithResults = false)
Parameters
System. Determines whether the fields in the selection should be replaced with their result values. |
Returns
Rad A Rad |
EndUpdate()
Declaration
public void EndUpdate()
GetAnnotationMarkersOfType<T>()
Gets all annotation markers of type T in the selection.
Declaration
public IEnumerable<T> GetAnnotationMarkersOfType<T>()
where T : AnnotationMarkerBase
Returns
System. A collection containing the annotation markers of type T in the selection. |
Type Parameters
T
|
GetFullSelectionGeometry()
Gets a Geometry instance describing the form of the selection.
Declaration
public Geometry GetFullSelectionGeometry()
Returns
GetSelectedBoxes()
Enumerates through all inline layout boxes included in the selected ranges.
Declaration
public IEnumerable<InlineLayoutBox> GetSelectedBoxes()
Returns
System. A collection of inline layout boxes. |
GetSelectedBoxes<T>()
Enumerates through all inline layout boxes of type T
included in the selected ranges.
Declaration
public IEnumerable<T> GetSelectedBoxes<T>()
where T : InlineLayoutBox
Returns
System. A collection of inline layout boxes of type |
Type Parameters
T
|
GetSelectedParagraphs()
Gets the paragraphs included in the selection.
Declaration
public IEnumerable<Paragraph> GetSelectedParagraphs()
Returns
System. A collection containing the paragraphs in the selection. |
GetSelectedSingleInline()
Gets the selected Inline if it is the only inline selected, otherwise returns null
.
For example, it is suitable to check if only a Image
Declaration
public Inline GetSelectedSingleInline()
Returns
Inline
Returns the selected Inline if it is the only inline selected, otherwise returns |
GetSelectedSingleShape()
Gets the selected shape inline if it is the only inline selected, otherwise returns null
.
Declaration
public ShapeInline GetSelectedSingleShape()
Returns
GetSelectedText()
Gets the selected text.
Declaration
public string GetSelectedText()
Returns
System. The text of the selection. |
GetSelectedText(Boolean)
Gets the selected text.
Declaration
public string GetSelectedText(bool includeListsText)
Parameters
System. If set to |
Returns
System. The text of the selection. |
GetVisibleSelectionGeometry(RectangleF)
Gets a Geometry instance describing the form of the selection visible in the visibleRectangle
.
Declaration
public Geometry GetVisibleSelectionGeometry(RectangleF visibleRectangle)
Parameters
Rectangle The rectangle used to clip the selection. |
Returns
OnSelectionChanged()
Called after the selection is changed.
Declaration
protected virtual void OnSelectionChanged()
OnSelectionChanging()
Called before the selection is changed.
Declaration
protected virtual void OnSelectionChanging()
RemoveSelectionPositionsAnchor()
Declaration
public void RemoveSelectionPositionsAnchor()
SelectAll()
Selects all elements in the document.
Declaration
public void SelectAll()
SelectAnnotationRange(AnnotationRangeStart)
Selects annotation range including the Annotation
Declaration
public void SelectAnnotationRange(AnnotationRangeStart annotationStart)
Parameters
Annotation The Annotation |
SelectTableColumn(Table, Int32)
Creates a new selection containing all the cells at a specified table grid column index.
The table grid is the set of grid columns which define all of the shared vertical edges of the table.
Declaration
public void SelectTableColumn(Table table, int gridColumnIndex)
Parameters
Table
table
The table containing the column that should be selected. |
System. The index of the table grid column that should be selected. |
SelectTableColumn(TableCell)
Creates a new selection containing all the cells at the table grid column index of the specified table cell.
Declaration
public void SelectTableColumn(TableCell tableCell)
Parameters
Table A cell from the column that should be selected. |
SelectTableRow(TableRow)
Creates a new selection containing the specific table row.
Declaration
public void SelectTableRow(TableRow tableRow)
Parameters
Table The table row that should be selected. |
SetSelectionStart(DocumentPosition)
Empties the selection and begins a new Selectionposition
.
This method starts the creation of a range, which should be finished with Add
Declaration
public void SetSelectionStart(DocumentPosition position)
Parameters
Document The start position. |
ToString()
Gets the text from the selected document elements.
Declaration
public override string ToString()
Returns
System. A |
Overrides
Events
SelectionChanged
Occurs after the selection is changed.
Declaration
public event EventHandler SelectionChanged
Event Type
System.
|
SelectionChanging
Occurs before the selection is changed.
Declaration
public event EventHandler SelectionChanging
Event Type
System.
|