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.
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
Init ( ) : void

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

Method Details

ContainingObject() public méthode

ContainingObject info about anchor.
public ContainingObject ( int level ) : int
level int
Résultat int

ContainingObject() public méthode

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
Résultat int

ContainingObjectIndex() public méthode

ContainingObjectIndex info about anchor.
public ContainingObjectIndex ( int level ) : int
level int
Résultat int

ContainingObjectIndex() public méthode

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
Résultat int

ContainingObjectTag() public méthode

ContainingObjectTag info about anchor.
public ContainingObjectTag ( int level ) : int
level int
Résultat int

ContainingObjectTag() public méthode

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
Résultat int

Hvo() public méthode

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
Résultat int

Levels() public méthode

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
Résultat int

SelectedProperty() public méthode

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
Résultat ITsString

Tag() public méthode

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
Résultat int

TextSelInfo() public méthode

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

TextSelInfo() public méthode

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

WsAlt() public méthode

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
Résultat int