C# Class SIL.FieldWorks.Common.RootSites.TextSelInfo

TextSelInfo is another variety of selection helper. It provides easy access to certain kinds of information in a selection. NOTE: some clients (e.g. EditingHelper.TextSelInfoBeforeEdit) depend upon the information cached in this object even after the underlying Selection has changed state.
ファイルを表示 Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
ContainingObject ( int level ) : int

ContainingObject info about anchor.

ContainingObject ( int level, bool fEndPoint ) : int

Level 0 returns the same object as Hvo(fEndPoint). Level 1 returns the object which contains the display of ContainingObject(0, fEndPoint). Level n returns the object which contains the display of ContainingObject(n-1, fEndPoint). Returns 0 if there was no selection or level is too large.

ContainingObjectIndex ( int level ) : int

ContainingObjectIndex info about anchor.

ContainingObjectIndex ( int level, bool fEndPoint ) : int

Level 0 returns zero. Level 1 returns the index of ContainingObject(0, fEndPoint) in property ContainingObjectTag(1, fEndPoint) of object ContainingObject(1, fEndPoint). Level n returns the index of ContainingObject(n-1, fEndPoint) in property ContainingObjectTag(n, fEndPoint) of object ContainingObject(n, fEndPoint). Returns 0 if there was no selection or level is too large (or the relevant property is atomic).

ContainingObjectTag ( int level ) : int

ContainingObjectTag info about anchor.

ContainingObjectTag ( int level, bool fEndPoint ) : int

Level 0 returns the same as Tag(fEndPoint). Level 1 returns the id of the property of ContainingObject(1, fEndPoint) which contains ContainingObject(0, fEndPoint). Level 1 returns the id of the property of ContainingObject(n, fEndPoint) which contains ContainingObject(n-1, fEndPoint). Returns 0 if there was no selection or level is too large.

Hvo ( bool fEndPoint ) : int

The id of the object that has the text property (Tag(fEndPoint) in which the selection occurs. Zero if no selection.

Levels ( bool fEndPoint ) : int

The number of layers of containing objects in the selection (Levels - 1 is the largest meaningful argument to pass to any of the containing object methods).

SelectedProperty ( bool fEndPoint ) : ITsString

The string in which the selection occurs...if there's a difference, passing true gets the end-point string, false the anchor string. Both null if no selection.

Tag ( bool fEndPoint ) : int

The id of the string property in which the selection occurs. Pass true for the property in which the end point occurs, false for anchor. Zero if no selection.

TextSelInfo ( IVwRootBox rootbox ) : System

Construct a TextSelInfo from the current selection of the root box.

TextSelInfo ( IVwSelection sel ) : System

Initializes a new instance of the T:TextSelInfo class.

WsAlt ( bool fEndPoint ) : int

The writing system alternative of the selection. Note that this is not necessarily the writing system of the selected text, or even the character adjacent to the selected end point; it identifies an alternative in a multilingual alternative property, and is zero if there is no selection or if the selected property is not multilingual.

Private Methods

Method Description
Init ( ) : void

Do remaining initialization once we (might) have a selection.

Method Details

ContainingObject() public method

ContainingObject info about anchor.
public ContainingObject ( int level ) : int
level int
return int

ContainingObject() public method

Level 0 returns the same object as Hvo(fEndPoint). Level 1 returns the object which contains the display of ContainingObject(0, fEndPoint). Level n returns the object which contains the display of ContainingObject(n-1, fEndPoint). Returns 0 if there was no selection or level is too large.
public ContainingObject ( int level, bool fEndPoint ) : int
level int
fEndPoint bool
return int

ContainingObjectIndex() public method

ContainingObjectIndex info about anchor.
public ContainingObjectIndex ( int level ) : int
level int
return int

ContainingObjectIndex() public method

Level 0 returns zero. Level 1 returns the index of ContainingObject(0, fEndPoint) in property ContainingObjectTag(1, fEndPoint) of object ContainingObject(1, fEndPoint). Level n returns the index of ContainingObject(n-1, fEndPoint) in property ContainingObjectTag(n, fEndPoint) of object ContainingObject(n, fEndPoint). Returns 0 if there was no selection or level is too large (or the relevant property is atomic).
public ContainingObjectIndex ( int level, bool fEndPoint ) : int
level int
fEndPoint bool
return int

ContainingObjectTag() public method

ContainingObjectTag info about anchor.
public ContainingObjectTag ( int level ) : int
level int
return int

ContainingObjectTag() public method

Level 0 returns the same as Tag(fEndPoint). Level 1 returns the id of the property of ContainingObject(1, fEndPoint) which contains ContainingObject(0, fEndPoint). Level 1 returns the id of the property of ContainingObject(n, fEndPoint) which contains ContainingObject(n-1, fEndPoint). Returns 0 if there was no selection or level is too large.
public ContainingObjectTag ( int level, bool fEndPoint ) : int
level int
fEndPoint bool
return int

Hvo() public method

The id of the object that has the text property (Tag(fEndPoint) in which the selection occurs. Zero if no selection.
public Hvo ( bool fEndPoint ) : int
fEndPoint bool
return int

Levels() public method

The number of layers of containing objects in the selection (Levels - 1 is the largest meaningful argument to pass to any of the containing object methods).
public Levels ( bool fEndPoint ) : int
fEndPoint bool
return int

SelectedProperty() public method

The string in which the selection occurs...if there's a difference, passing true gets the end-point string, false the anchor string. Both null if no selection.
public SelectedProperty ( bool fEndPoint ) : ITsString
fEndPoint bool
return ITsString

Tag() public method

The id of the string property in which the selection occurs. Pass true for the property in which the end point occurs, false for anchor. Zero if no selection.
public Tag ( bool fEndPoint ) : int
fEndPoint bool
return int

TextSelInfo() public method

Construct a TextSelInfo from the current selection of the root box.
public TextSelInfo ( IVwRootBox rootbox ) : System
rootbox IVwRootBox
return System

TextSelInfo() public method

Initializes a new instance of the T:TextSelInfo class.
public TextSelInfo ( IVwSelection sel ) : System
sel IVwSelection The sel.
return System

WsAlt() public method

The writing system alternative of the selection. Note that this is not necessarily the writing system of the selected text, or even the character adjacent to the selected end point; it identifies an alternative in a multilingual alternative property, and is zero if there is no selection or if the selected property is not multilingual.
public WsAlt ( bool fEndPoint ) : int
fEndPoint bool
return int