Class Selection
Represents class used to manage selected part of the Edit control's text content.
public class Selection : ISelection, IDisposable
- Inheritance
-
Selection
- Implements
Constructors
- Selection()
Initializes a new instance of the
Selection
class with default settings.
- Selection(ISyntaxEdit)
Initializes a new instance of the
Selection
class with a specified owner.
Fields
Properties
- AllowedSelectionMode
Gets or sets type of selection allowed to Edit control content.
- BackColor
Gets or sets a background color of the
SelectedText
when owner control has input focus.
- BorderColor
Gets or sets a color of the selection border.
- ForeColor
Gets or sets a foreground color of the
SelectedText
when owner control has input focus.
- InActiveBackColor
Gets or sets a background color of the
SelectedText
when owner control does not have input focus.
- InActiveForeColor
Gets or sets a foreground color of the
SelectedText
when owner control does not have input focus.
- IsEmpty
Indicates whether nothing is selected.
- Options
Gets or sets options determining behaviour or the
Selection
.
- SelectedColorData
Gets or sets strings that corresponds to selected part of the control's text content.
- SelectedText
Gets or sets strings that corresponds to selected part of the control's text content.
- SelectedWordsBackColor
Gets or sets a background color used to fill highlighted selected word area.
- SelectionLength
Gets or sets length of the
SelectedText
.
- SelectionRect
Gets or sets rectangular area indicating selected text of the control.
- SelectionStart
Gets or sets the position of the first selected character while text considered as a single string.
- SelectionState
Gets or sets a value indicates state of the selected text.
- SelectionType
Gets or sets type of current selection. SelectionType
- UpdateCount
Keeps track of calls to
BeginUpdate
andEndUpdate
so that they can be nested.
Methods
- ApplyTextChanges(IList<ITextUndo>, bool)
Applies text changes to the text.
- Assign(ISelection)
Copies the contents from another
ISelection
object.
- BeginUpdate()
Prevents the
Selection
updating until theEndUpdate
method is called. EndUpdate()
- CanCopy()
Indicates whether selected text can be copied to the clipboard.
- CanCut()
Indicates whether selected text can be cut to the clipboard.
- CanDelete()
Indicates whether selected text can be deleted.
- CanDrag(Point)
Indicates whether the control can drag selected text.
- CanPaste()
Indicates whether the control can paste some text from the clipboard.
- Capitalize()
Changes first character of all words in selected text to upper-case and all another characters to lower-case.
- ChangeBlock(StringEvent)
Changes selected text by applying specified event to every line in the selected text.
- ChangeBlock(StringEvent, bool, bool)
Changes selected text by applying specified event to every line in the selected text.
- ChangeBlock(TextUndoEvent)
Changes selected text by applying specified event to every line in the selected text.
- ChangeBlock(TextUndoEvent, bool, bool)
Changes selected text by applying specified event to every line in the selected text.
- CharTransponse()
Transposes character under the caret with the next character.
- Clear()
Makes selection empty, without deleting its content.
- CollapseToDefinitions()
Collapses and expands some outline section to get a quick overall view of the Edit content.
- CommentSelection()
Marks the selected text as a comment, using the correct comment syntax for the programming language.
- Copy()
Copies
SelectedText
to the Clipboard.
- Cut()
Cuts
SelectedText
to the Clipboard.
- CutLine()
Cuts current line to the clipboard if no text selected; otherwise cuts selected text.
- Delete()
Deletes selected text from the control.
- Delete(ExtendedSelectionScope)
When implemented by a class, deletes selected text from the control.
- DeleteLeft()
Deletes one character left to the cursor.
- DeleteLine()
Deletes current line if no text selected; otherwise deletes selected text.
- DeleteRight()
Deletes one character right to the cursor.
- DeleteWhiteSpace()
Removes all space and tab characters from selected text. If nothing is selected the method removes space and tab characters from the current line.
- DeleteWordLeft()
Deletes one word left to the cursor.
- DeleteWordRight()
Deletes one word right to the cursor.
- Dispose()
Disposes this
Selection
and frees resources associated with it.
- DragTo(Point, bool)
Moves or copies selected text to the specified position.
- DuplicateLine()
Duplicates current line or selection in the control's content.
- EndSelection()
Stops selection.
- EndUpdate()
Re-enables selection updating turned off by calling
BeginUpdate
method. BeginUpdate()
- ~Selection()
Destroys the instance of the
Selection
class.
- GetSearchSelectionForLine(int, out int, out int, out SelectionType, out Rectangle)
Sets left and right parameter to the first and last selected characters within specified line, when edit control is in search selection mode.
- GetSelectionForLine(int, out int, out int)
Sets left and right index of the first and last selected characters within specified line.
- Indent()
Indents the selected text by one indentation level, inserting Tab or spaces to the beginning of the line.
- InsertString(string)
Inserts given text to the control's content deleting selected text if needed.
- Invalidate()
Invalidates a selection region of the editor control and causes a paint message to be sent to the editor control.
- Invalidate(SelectionType, Rectangle)
Invalidates a selection region of the editor control and causes a paint message to be sent to the editor control.
Selection type. Selection rectangle.
- IsPosInSelection(Point)
Indicates whether given position located within the selected region.
- IsPosInSelection(int, int)
Indicates whether given position located within the selected region.
- IsValidSelectionPoint(Point)
Indicates whether specified position located at the top-left or right-bottom corners of selection area.
- LineTransponse()
Transposes line under the caret with the next line.
- LowerCase()
Converts all selected characters to the lower-case.
- Modified()
Responds on any modifications in the editor.
- Move(Point, bool)
Moves or copies selected text to the specified position.
- MoveSelectionDown()
Moves selected text to the following line in the control.
- MoveSelectionUp()
Moves selected text to the preceding line in the control.
- NewLine()
Inserts a line break at the current position of the control.
- NewLineAbove()
Inserts a line break above the current position of the control.
- NewLineBelow()
Inserts a line break below the current position of the control.
- OnAfterPaste()
Raises
AfterPaste
event.
- OnBeforePaste(ref string, ref SelectionType)
Raises
BeforePaste
event.
- OnSelect(object, EventArgs)
Selects part of text source settings. Reserved for internal use.
- OnSelectionChanged()
Raises
SelectionChanged
event.
- Paste()
Pastes the content of the Clipboard to the Edit control, replacing selected text if needed.
- PositionChanged(int, int, int, int)
Responds on changing position in the editor.
- ProcessEscape()
Processes escape pressure: method deselects selected text.
- ProcessShiftTab()
Moves current position to the previous tab stop if the selected text is empty; otherwise unindents selected text.
- ProcessTab()
Inserts new tab character or spaces if the selected text is empty; otherwise indents selected text.
- ResetAllowedSelectionMode()
Resets the
AllowedSelectionMode
to the default value.
- ResetBackColor()
Resets the
BackColor
to the default value.
- ResetBorderColor()
Resets the
BorderColor
to the default value.
- ResetForeColor()
Resets the
ForeColor
to the default value.
- ResetInActiveBackColor()
Resets the
InActiveBackColor
to the default value.
- ResetInActiveForeColor()
Resets the
InActiveForeColor
to the default value.
- ResetOptions()
Resets the
Options
to the default value.
- ResetSelectedWordColor()
Resets the
SelectedWordsColor
to the default value.
- ScrollIfNeeded(Point)
Scrolls to specified position if needed.
- SelectAll()
Selects all lines in the control's content.
- SelectCharLeft()
Increases selection to one character at the left side of the selection region.
- SelectCharLeft(SelectionType)
Increases selection to one character at the left side of the selection region and sets a given selection type.
- SelectCharRight()
Increases selection to one character at the right side of the selection region.
- SelectCharRight(SelectionType)
Increases selection to one character at the right side of the selection region and sets a given selection type.
- SelectCurrentWord()
Tries to select word nearest to the current position in the control.
- SelectFileBegin()
Increases selection to beginning of the control's content.
- SelectFileBegin(SelectionType)
Increases selection to beginning of the control's content and sets a given selection type.
- SelectFileEnd()
Increases selection to end of the control's content.
- SelectFileEnd(SelectionType)
Increases selection to end of the control's content and sets a given selection type.
- SelectLine()
Selects entire line at the current position in the control.
- SelectLineBegin()
Selects from current position to the beginning of current line in the control.
- SelectLineBegin(SelectionType)
Selects from current position to the beginning of current line in the control and sets a given selection type.
- SelectLineDown()
Increases selection to the following line in the control.
- SelectLineDown(SelectionType)
Increases selection to the following line in the control and sets a given selection type.
- SelectLineEnd()
Selects from current position to the end of current line in the control.
- SelectLineEnd(SelectionType)
Selects from current position to the end of current line in the control and sets a given selection type.
- SelectLineOnTrippleClick()
Selects entire line at the current position in the control as a result of triple click.
- SelectLineUp()
Increases selection to the preceding line in the control.
- SelectLineUp(SelectionType)
Increases selection to the preceding line in the control and sets a given selection type.
- SelectNextWord()
Select word next to the current word.
- SelectPageDown()
Increases selection to the one page down in the control.
- SelectPageDown(SelectionType)
Increases selection to the one page down in the control and sets a given selection type.
- SelectPageUp()
Increases selection to the one page up in the control.
- SelectPageUp(SelectionType)
Increases selection to the one page up in the control and sets a given selection type.
- SelectScreenBottom()
Increases selection to the end of screen.
- SelectScreenBottom(SelectionType)
Increases selection to the end of the screen and sets a given selection type.
- SelectScreenTop()
Increases selection to the begin of screen.
- SelectScreenTop(SelectionType)
Increases selection to the begin of the screen and sets a given selection type.
- SelectToBrace()
Increases selection to the next open or closing brace.
- SelectToCloseBrace()
Increases selection to the next closing brace.
- SelectToOpenBrace()
Increases selection to the prev open brace.
- SelectWord()
Selects a word at the current position in the control.
- SelectWordLeft()
Increases selection to the word located at the left side of the current position in the control.
- SelectWordLeft(SelectionType)
Increases selection to the word located at the left side of the current position in the control and sets a given selection type.
- SelectWordRight()
Increases selection to the word located at the right side of the current position in the control.
- SelectWordRight(SelectionType)
Increases selection to the word located at the right side of the current position in the control and sets a given selection type.
- SelectedCount()
Returns amount of the lines being selected.
- SelectedData(int)
Returns selected part of color information at specified position.
- SelectedString(int)
Returns selected part of string at specified position.
- SelectionToScreen()
Represents selection region in a screen coordinates.
- SelectionToTextPoint(Point)
Converts given selection coordinate to the text coordinate.
- SetSelectedText(string, SelectionType)
Replaces
SelectedText
by specified text.
- SetSelectedText(string, SelectionType, bool)
Replaces
SelectedText
by specified text.
- SetSelection(SelectionType, Point, Point)
Sets new selection region with specified selection type.
- SetSelection(SelectionType, Rectangle)
Sets new selection region with specified selection type.
- ShouldSerializeAllowedSelectionMode()
Indicates whether the
AllowedSelectionMode
property should be persisted.
- ShouldSerializeBackColor()
Indicates whether the
BackColor
property should be persisted.
- ShouldSerializeBorderColor()
Indicates whether the
BorderColor
property should be persisted.
- ShouldSerializeForeColor()
Indicates whether the
FontColor
property should be persisted.
- ShouldSerializeInActiveBackColor()
Indicates whether the
InActiveBackColor
property should be persisted.
- ShouldSerializeInActiveForeColor()
Indicates whether the
InActiveForeColor
property should be persisted.
- ShouldSerializeOptions()
Indicates whether the
Options
property should be persisted.
- ShouldSerializeSelectedWordsBackColor()
Indicates whether the
SelectedWordsBackColor
property should be persisted.
- SmartFormat()
Formats selected text using indentation obtained from Syntax Parser supporting
Alternet.Syntax.SyntaxOptions.SmartIndent
.
- SmartFormat(char)
Formats given line using indentation obtained from Syntax Parser supporting
Specifies Character being typedAlternet.Syntax.SyntaxOptions.SmartIndent
.
- SmartFormat(int)
Formats given line using indentation obtained from Syntax Parser supporting
Alternet.Syntax.SyntaxOptions.SmartIndent
.
- SmartFormatBlock(bool, char)
Formats current syntax block using indentation obtained from Syntax Parser supporting
Alternet.Syntax.SyntaxOptions.SmartIndent
.
- SmartFormatDocument()
Formats entire document using indentation obtained from Syntax Parser supporting
Alternet.Syntax.SyntaxOptions.SmartIndent
.
- SmartFormatSelection()
Formats selected text using indentation obtained from Syntax Parser supporting
Alternet.Syntax.SyntaxOptions.SmartIndent
.
- SmartIndent()
Positions the cursor to the line indentation level, obtained from parser supporting
Alternet.Syntax.SyntaxOptions.SmartIndent
option when user presses Enter.
- SmartIndent(char)
Formats given current line using indentation obtained from Syntax Parser supporting
Specifies character being typedAlternet.Syntax.SyntaxOptions.SmartIndent
.
- StartSelection()
Forces selection start.
- SwapAnchor()
Change current position from beginning of selection rectangle to the end of selection rectangle or vice versa.
- Tabify()
Converts spaces to tabs in the current string within the selected area according to tab settings.
- TextToSelectionPoint(Point)
Converts given text coordinate to the selection coordinate.
- ToggleComment()
Toggles the selected text as a comment\uncomment, using the correct comment syntax for the programming language.
- ToggleOutlining()
Toggles expanded state for all
IOutlineRange
objects in outline collection.
- ToggleOverWrite()
Toggles the control's overwrite mode.
- UnIndent()
Unindents the selected text by one indentation level, deleting Tab or spaces from the beginning of the line.
- UnTabify()
Converts tabs to spaces in the current string within the selected area according to tab settings.
- UncommentSelection()
Removes the comment syntax from the selected text.
- UpdateSelRange(Point, Point)
Updates selection start and end to the specified position.
- UpdateSelStart(bool)
Updates selection start to the specified position.
- UpdateSelStart(Point)
Updates selection start to the specified position.
- UpdateSelection()
Invalidates selected region.
- UpperCase()
Converts all selected characters to the upper-case.
- WordTransponse()
Transposes word under the caret with the next word.
Events
- AfterPaste
Occurs when text is already pasted.
- BeforePaste
Occurs when text is about to be pasted.
- SelectionChanged
Occurs when selection bounds are changed.