C# Class SIL.FieldWorks.SharpViews.Selections.Selection

The base class for all selections.
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
ApplyStyle ( string style ) : void
CanApplyStyle ( string style ) : bool
CanDelete ( ) : bool

Return true if Delete() will delete something. Default is that it will not.

Contains ( InsertionPoint ip ) : bool

Answer true if the selection is contained in the other, that is, it is associated with one of the selected characters.

Delete ( ) : void

Delete the selected material, or whatever else is appropriate when the Delete key is pressed. (Insertion Point deletes the following character.) Default is to do nothing.

GetSelectionLocation ( IVwGraphics graphics, PaintTransform transform ) : Rectangle

Get the location, in the coordinates indicated by the transform, of a rectangle that contains the primary insertion point. Todo JohnT: there should be a parallel routine to get the location of the secondary rectangle.

InsertRtfString ( string input ) : bool
InsertText ( string input ) : bool
InsertTsString ( ITsString input ) : bool
Install ( ) : void

Install this selection as the current one for the root box.

MoveByKey ( KeyEventArgs args ) : Selection

Return the selection that should be produced by a KeyDown event with the specified arguments. If the argument does not specify a key-moving event or it is not possible to move (e.g., left arrow at start of document), return null.

RestoreData ( Selection dataToSave ) : ISelectionRestoreData
SelectedText ( ) : string

Private Methods

Method Description
Draw ( IVwGraphics vg, PaintTransform ptrans ) : void

Draw the selection on the VwGraphics.

Invalidate ( ) : void

Invalidate the selection, that is, mark the rectangle it occupies as needing to be painted in the containing control.

Method Details

ApplyStyle() public method

public ApplyStyle ( string style ) : void
style string
return void

CanApplyStyle() public method

public CanApplyStyle ( string style ) : bool
style string
return bool

CanDelete() public method

Return true if Delete() will delete something. Default is that it will not.
public CanDelete ( ) : bool
return bool

Contains() public method

Answer true if the selection is contained in the other, that is, it is associated with one of the selected characters.
public Contains ( InsertionPoint ip ) : bool
ip InsertionPoint
return bool

Delete() public method

Delete the selected material, or whatever else is appropriate when the Delete key is pressed. (Insertion Point deletes the following character.) Default is to do nothing.
public Delete ( ) : void
return void

GetSelectionLocation() public abstract method

Get the location, in the coordinates indicated by the transform, of a rectangle that contains the primary insertion point. Todo JohnT: there should be a parallel routine to get the location of the secondary rectangle.
public abstract GetSelectionLocation ( IVwGraphics graphics, PaintTransform transform ) : Rectangle
graphics IVwGraphics
transform PaintTransform
return System.Drawing.Rectangle

InsertRtfString() public method

public InsertRtfString ( string input ) : bool
input string
return bool

InsertText() public method

public InsertText ( string input ) : bool
input string
return bool

InsertTsString() public method

public InsertTsString ( ITsString input ) : bool
input ITsString
return bool

Install() public method

Install this selection as the current one for the root box.
public Install ( ) : void
return void

MoveByKey() public method

Return the selection that should be produced by a KeyDown event with the specified arguments. If the argument does not specify a key-moving event or it is not possible to move (e.g., left arrow at start of document), return null.
public MoveByKey ( KeyEventArgs args ) : Selection
args System.Windows.Forms.KeyEventArgs
return Selection

RestoreData() public abstract method

public abstract RestoreData ( Selection dataToSave ) : ISelectionRestoreData
dataToSave Selection
return ISelectionRestoreData

SelectedText() public method

public SelectedText ( ) : string
return string