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

An insertion point represents a specific position in text between two characters. It can also represent one end of a range. It is implemented as a position relative to a particular StringParaHookup, which in turn links it to a particular paragraph box and client run
Inheritance: TextSelection
ファイルを表示 Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
Associate InsertionPoint
BackspaceDeleteLineBreak void
CopyFrom void
DeleteLineBreak void
Draw void
InsertLineBreak void
InsertionPoint System
IsValidInsertionPoint bool
MoveBack InsertionPoint
MoveForward InsertionPoint
MoveUpOrDown InsertionPoint

Public Methods

Method Description
ApplyStyle ( string style ) : void

Changes the Selection's style

Backspace ( ) : void

Implement the backspace key function (delete one character, or merge two paragraphs).

CanApplyStyle ( string style ) : bool

Checks whether the Selection's style can be changed

CanDelete ( ) : bool

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

Delete ( ) : void

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

ExpandToWord ( ) : RangeSelection
GetParagraphOps ( IParagraphOperations &paragraphOps, GroupHookup &parentHookup, int &index ) : bool
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

Insert the specified text at the insertion point. Enhance JohnT: normalize the string after the edit, maintaining the posititon of the IP correctly.

InsertTsString ( ITsString input ) : bool
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.

NextIp ( int distance ) : InsertionPoint
RestoreData ( Selection dataToSave ) : ISelectionRestoreData
SameLocation ( InsertionPoint other ) : bool

True if the two selections are at the same place (ignoring AssociatePrevious).

ToString ( ) : string

Private Methods

Method Description
Associate ( bool previous ) : InsertionPoint
BackspaceDeleteLineBreak ( ) : void
CopyFrom ( InsertionPoint other ) : void

Make your state equivalent to the other IP.

DeleteLineBreak ( ) : void
Draw ( IVwGraphics vg, PaintTransform ptrans ) : void
InsertLineBreak ( ) : void
InsertionPoint ( LiteralStringParaHookup hookup, int position, bool fAssocPrev ) : System
IsValidInsertionPoint ( int runIndex, int ichRun ) : bool
MoveBack ( ) : InsertionPoint
MoveForward ( ) : InsertionPoint
MoveUpOrDown ( int delta ) : InsertionPoint

Move the insertion point up or down (depending on the sign of delta). Records an x position in the selection, so further moves down from the new IP as a starting point stay aligned as nearly as possible with the start position.

Method Details

ApplyStyle() public method

Changes the Selection's style
public ApplyStyle ( string style ) : void
style string
return void

Backspace() public method

Implement the backspace key function (delete one character, or merge two paragraphs).
public Backspace ( ) : void
return void

CanApplyStyle() public method

Checks whether the Selection's style can be changed
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

Delete() public method

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

ExpandToWord() public method

public ExpandToWord ( ) : RangeSelection
return RangeSelection

GetParagraphOps() public method

public GetParagraphOps ( IParagraphOperations &paragraphOps, GroupHookup &parentHookup, int &index ) : bool
paragraphOps IParagraphOperations
parentHookup SIL.FieldWorks.SharpViews.Hookups.GroupHookup
index int
return bool

GetSelectionLocation() public 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 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

Insert the specified text at the insertion point. Enhance JohnT: normalize the string after the edit, maintaining the posititon of the IP correctly.
public InsertText ( string input ) : bool
input string
return bool

InsertTsString() public method

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

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

NextIp() public method

public NextIp ( int distance ) : InsertionPoint
distance int
return InsertionPoint

RestoreData() public method

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

SameLocation() public method

True if the two selections are at the same place (ignoring AssociatePrevious).
public SameLocation ( InsertionPoint other ) : bool
other InsertionPoint
return bool

ToString() public method

public ToString ( ) : string
return string