C# Класс 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
Наследование: TextSelection
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Associate InsertionPoint
BackspaceDeleteLineBreak void
CopyFrom void
DeleteLineBreak void
Draw void
InsertLineBreak void
InsertionPoint System
IsValidInsertionPoint bool
MoveBack InsertionPoint
MoveForward InsertionPoint
MoveUpOrDown InsertionPoint

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

ApplyStyle() публичный Метод

Changes the Selection's style
public ApplyStyle ( string style ) : void
style string
Результат void

Backspace() публичный Метод

Implement the backspace key function (delete one character, or merge two paragraphs).
public Backspace ( ) : void
Результат void

CanApplyStyle() публичный Метод

Checks whether the Selection's style can be changed
public CanApplyStyle ( string style ) : bool
style string
Результат bool

CanDelete() публичный Метод

Return true if Delete() will delete something. Default is that it will not.
public CanDelete ( ) : bool
Результат bool

Delete() публичный Метод

Delete the selected material, or whatever else is appropriate when the Delete key is pressed. (Insertion Point deletes the following character.)
public Delete ( ) : void
Результат void

ExpandToWord() публичный Метод

public ExpandToWord ( ) : RangeSelection
Результат RangeSelection

GetParagraphOps() публичный Метод

public GetParagraphOps ( IParagraphOperations &paragraphOps, GroupHookup &parentHookup, int &index ) : bool
paragraphOps IParagraphOperations
parentHookup SIL.FieldWorks.SharpViews.Hookups.GroupHookup
index int
Результат bool

GetSelectionLocation() публичный Метод

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
Результат System.Drawing.Rectangle

InsertRtfString() публичный Метод

public InsertRtfString ( string input ) : bool
input string
Результат bool

InsertText() публичный Метод

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
Результат bool

InsertTsString() публичный Метод

public InsertTsString ( ITsString input ) : bool
input ITsString
Результат bool

MoveByKey() публичный Метод

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
Результат Selection

NextIp() публичный Метод

public NextIp ( int distance ) : InsertionPoint
distance int
Результат InsertionPoint

RestoreData() публичный Метод

public RestoreData ( Selection dataToSave ) : ISelectionRestoreData
dataToSave Selection
Результат ISelectionRestoreData

SameLocation() публичный Метод

True if the two selections are at the same place (ignoring AssociatePrevious).
public SameLocation ( InsertionPoint other ) : bool
other InsertionPoint
Результат bool

ToString() публичный Метод

public ToString ( ) : string
Результат string