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

Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Méthodes publiques

Свойство Type Description
s_mockedSelectionHelper SelectionHelper

Private Properties

Свойство Type Description
AppendLevel void
ContraryLimit SelLimitType
GetIndex int
GetSelEndInfo bool
GetSelInfo SelInfo
GetSelectionProps void
GetWsOfSelection int
InsertLevel void
IsEnd bool
MakeRangeSelection IVwSelection
OnRootSiteDisposed void
RemoveLevel void
RemoveLevelAt void

Méthodes publiques

Méthode Description
AppendLevel ( int tag, int ihvo, int ws ) : void

Appends a selection level for the specified tag.

Create ( IVwRootSite rootSite ) : SelectionHelper

Create a SelectionHelper with the information about the current selection.

Create ( IVwSelection vwSel, IVwRootSite rootSite ) : SelectionHelper

Create a SelectionHelper with the information about the current selection.

GetAssocPrev ( SelLimitType type ) : bool

Indicates whether of not the insertion point should be associated with the characters immediately preceding it in the view (default) or not.

GetCurrSelectionProps ( ITsTextProps &vttp, IVwPropertyStore &vvps ) : void

Gets the selection props for the current selection

GetFirstWsOfSelection ( IVwSelection vwsel ) : int

Retrieve the first language writing system used by the given selection.

ENHANCE JohnT: Should this be a COM method for IVwSelection?

GetHardAndSoftCharProps ( IVwSelection vwSel, ITsTextProps &vttp, IVwPropertyStore &vvpsSoft, int &cttp ) : void

This is like GetSelectionProps, except that the vvpsSoft items include all formatting MINUS the hard formatting in the text properties (ie, those derived by the view constructor and styles).

GetIch ( SelLimitType type ) : int

Gets the 0-based index of the character for the given limit of the selection.

GetIhvoRoot ( SelLimitType type ) : int

Gets the index of the root object for the given limit of the selection. This is 0 for views that don't display mutliple root objects).

GetLevelForTag ( int tag ) : int

Returns the level number of the specified tag for this selection. NOTE: This version only searches the anchor for the specified tag.

GetLevelForTag ( int tag, SelLimitType limitType ) : int

Returns the level number of the specified tag for this selection.

GetLevelInfo ( SelLimitType type ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]

Gets the array of VwSelLevInfo. Array elements should indicate the chain of objects that needs to be traversed to get from the root object to object where the selection is to be made. The tag for item n should be the flid in which the children of the root object are owned. The 0th element of this array must have its tag value set to BaseStText.StTextTags.kflidParagraphs. This is set automatically whenever the array is resized using Cvsli.

GetLevelInfoForTag ( int tag ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo

Returns the selection level info for the specified tag found in the level info for this selection. NOTE: This version only searches the anchor for the specified tag.

GetLevelInfoForTag ( int tag, SelLimitType limitType ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo

Returns the selection level info for the specified tag found in the level info for this selection.

GetLevelInfoForTag ( int tag, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo &selLevInfo ) : bool

Retrieves the selection level info for the specified tag found in the level info for this selection. NOTE: This version only searches the anchor for the specified tag.

GetLevelInfoForTag ( int tag, SelLimitType limitType, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo &selLevInfo ) : bool

Retrieves the selection level info for the specified tag found in the level info for this selection.

GetLocation ( ) : Point

Get the location of the selection TODO: Make this work in PrintLayout view

GetNumberOfLevels ( SelLimitType type ) : int

Gets the number of levels needed to traverse the view objects to reach the given limit of the selection.

GetNumberOfPreviousProps ( SelLimitType type ) : int

Gets the number of previous elements for the given limit of the selection

GetParaProps ( IVwSelection vwSel, IVwPropertyStore &vvps, int &cvps ) : void

Gets the paragraph properties for the specified IVwSelection

GetSelProps ( SelLimitType type ) : ITsTextProps

Get the text props associated with the given end of the selection.

GetSelectionInfo ( IVwSelection vwSel, IVwRootSite rootSite ) : SelectionHelper

Gets all information about a selection by calling IVwSelection.AllTextSelInfo.

GetTextPropId ( SelLimitType type ) : int

Gets the text property that occurs at the indicated end of the selection.

GetTss ( SelLimitType limit ) : ITsString

Get the TsString of the property where the given selection limit is located. This gets the entire TSS of the paragraph, not just the selected portion.

GetWritingSystem ( SelLimitType type ) : int

Get the writing system associated with the insertion point.

Note: If you need the writing system for the selection, you should use GetFirstWsOfSelection.

GetWsOfEntireSelection ( IVwSelection vwsel ) : int

Retrieve the language writing system used by the given selection. If the selection has no writing system or contains more than one writing system, zero is returned.

ENHANCE JohnT (DaveO): This should this be a COM method for IVwSelection

InsertLevel ( int iLev, int tag, int ihvo, int ws ) : void

Appends a selection level for the specified tag.

IsEditable ( ITsTextProps ttp, IVwPropertyStore vps ) : bool

Determine if text that belongs to ttp and vps is editable.

IsEditable ( IVwSelection sel ) : bool

Determine if selection is editable

IsFlidInLevelInfo ( int flid, SelLimitType limitType ) : bool

Determines whether the specified flid is located in the level info for the selection

MakeBest ( IVwRootSite rootsite, bool fMakeVisible ) : IVwSelection

The requested anchor and endpoint may be beyond the end of the string. Try to make a selection as near the end of the string as possible.

MakeBest ( bool fMakeVisible ) : IVwSelection

The requested anchor and endpoint may be beyond the end of the string. Try to make a selection as near the end of the string as possible.

MakeRangeSelection ( IVwRootBox rootBox, bool fInstall ) : IVwSelection

Make a range selection based upon our saved selection info. NOTE: Installing the selection may trigger side effects that will invalidate the selection. Callers should check to make sure the selection is still valid before using it.

ReduceSelectionToIp ( IVwRootSite rootSite, SelLimitType limit, bool fMakeVisible ) : SelectionHelper

Reduce a range selection to a simple insertion point, specifying which limit of the range selection to use as the position for the new IP.

ReduceSelectionToIp ( IVwRootSite rootSite, SelLimitType limit, bool fMakeVisible, bool fInstall ) : SelectionHelper

Reduce a range selection to a simple insertion point, specifying which limit of the range selection to use as the position for the new IP.

ReduceSelectionToIp ( SelLimitType limit, bool fMakeVisible, bool fInstall ) : SelectionHelper

Gets a (new) selection helper that represents an insertion point at the specified limit of this selection

ReduceToIp ( SelLimitType limit, bool fMakeVisible, bool fInstall ) : IVwSelection

This is the workhorse that actually reduces a range selection to a simple insertion point, given the specified index to indicate the limit where the IP is to be created.

ReduceToIp ( SelLimitType limit ) : void

Reduces this selection to an insertion point at the specified limit. Will not install or make visible.

RemoveLevel ( int tag ) : void

Removes the selection level for the specified tag.

RemoveLevelAt ( int ilev ) : void

Remove the specified level from the SelLevInfo for both ends.

RestoreScrollPos ( ) : void

Scrolls the selection to its original scroll position.

RestoreSelectionAndScrollPos ( ) : bool

Makes a selection then scrolls the window so the IP is at the same vertical position it was when this selection helper object was created. This method is used mainly after reconstructing a view. After reconstruction, the desire is to not only have the IP back in the data where it was before reconstruction, but to have the same number of pixels between the IP and the top of the view. This method does it's best to do this.

SelectionHelper ( ) : System

The default constructor must be followed by a call to SetSelection before it will really be useful

SelectionHelper ( SelectionHelper src ) : System

Copy constructor

SetAssocPrev ( SelLimitType type, bool value ) : void

Indicates whether of not the insertion point should be associated with the characters immediately preceding it in the view (default) or not.

SetIPAfterUOW ( ) : void

Make an insertion point based upon our saved anchor selection info. It will not be set until after the unit of work.

SetIPAfterUOW ( IVwRootSite rootSite ) : void

Make an insertion point based upon our saved anchor selection info. It will not be set until after the unit of work.

SetIch ( SelLimitType type, int value ) : void

Sets the 0-based index of the character for the given limit of the selection. If appropriate records that the end of the selection has been set explicitly.

SetIhvoRoot ( SelLimitType type, int value ) : void

Sets the index of the root object for the given limit of the selection. This is 0 for views that don't display mutliple root objects).

SetLevelInfo ( SelLimitType type, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo value ) : void

Sets the array of SelLevInfo.

SetNumberOfLevels ( SelLimitType type, int value ) : void

Sets the number of levels needed to traverse the view objects to reach the given limit of the selection.

SetNumberOfPreviousProps ( SelLimitType type, int value ) : void

Sets the number of previous elements for the given limit of the selection

SetSelProps ( SelLimitType type, ITsTextProps value ) : void

Set the text props associated with the given end of the selection.

SetSelection ( IVwRootSite rootSite ) : IVwSelection

Sets the selection

SetSelection ( IVwRootSite rootSite, bool fInstall, bool fMakeVisible ) : IVwSelection

Sets the selection by calling IVwRootBox.MakeRangeSelection.

SetSelection ( IVwRootSite rootSite, bool fInstall, bool fMakeVisible, VwScrollSelOpts scrollOption ) : IVwSelection

Sets the selection by calling IVwRootBox.MakeRangeSelection.

SetSelection ( bool fMakeVisible ) : IVwSelection

Sets and install the selection in the previously supplied rootsite.

SetSelection ( bool fInstall, bool fMakeVisible ) : IVwSelection

Sets the selection by calling IVwRootBox.MakeRangeSelection.

SetTextPropId ( SelLimitType type, int tagTextProp ) : void

Sets the text property that occurs at the indicated end of the selection.

SetWritingSystem ( SelLimitType type, int value ) : void

Set the writing system associated with the insertion point.

Note: If you need the writing system for the selection, you should use GetFirstWsOfSelection.

UpdateScrollLocation ( ) : void

Updates the internal scroll location for this selection to be up-to-date, if possible.

Méthodes protégées

Méthode Description
SelectionHelper ( IVwSelection vwSel, IVwRootSite rootSite ) : System

Create a selection helper based on an existing selection

Private Methods

Méthode Description
AppendLevel ( int tag, int ihvo, int ws, SelLimitType type ) : void

Appends a selection level for the specified tag.

ContraryLimit ( SelLimitType limit ) : SelLimitType

Returns the contrary limit

GetIndex ( SelLimitType type ) : int

Returns the index used for the appropriate limit type

GetSelEndInfo ( bool fEnd ) : bool

Get information about the selection

GetSelInfo ( SelLimitType type ) : SelInfo

Gets the internal selection info for the requested end of the selection.

GetSelectionProps ( IVwSelection vwSel, ITsTextProps &vttp, IVwPropertyStore &vvps, int &cttp ) : void
GetWsOfSelection ( IVwSelection vwsel, bool fStopAtFirstWs ) : int

This is the implementation for GetWsOfEntireSelection and GetFirstWsOfSelection. It retrieves the language writing system used by the given selection.

ENHANCE JohnT: Should this be a COM method for IVwSelection?

InsertLevel ( int iLev, int tag, int ihvo, int ws, SelLimitType type ) : void

Appends a selection level for the specified tag.

IsEnd ( SelLimitType type ) : bool

Determines whether the specified type is the end.

MakeRangeSelection ( IVwRootSite rootSite, bool fInstall ) : IVwSelection

Make a range selection based upon our saved selection info. NOTE: Installing the selection may trigger side effects that will invalidate the selection. Callers should check to make sure the selection is still valid before using it.

OnRootSiteDisposed ( object sender, EventArgs e ) : void

Called when the root site gets disposed. We can't use m_rootSite any more.

RemoveLevel ( int tag, SelLimitType type ) : void

Removes the selection level for the specified tag.

RemoveLevelAt ( int iLevel, SelLimitType type ) : void

Method Details

AppendLevel() public méthode

Appends a selection level for the specified tag.
public AppendLevel ( int tag, int ihvo, int ws ) : void
tag int The tag.
ihvo int The index of the object to insert in the appended level
ws int HVO of the writing system, if the property is a Multitext
Résultat void

Create() public static méthode

Create a SelectionHelper with the information about the current selection.
public static Create ( IVwRootSite rootSite ) : SelectionHelper
rootSite IVwRootSite The root site
Résultat SelectionHelper

Create() public static méthode

Create a SelectionHelper with the information about the current selection.
public static Create ( IVwSelection vwSel, IVwRootSite rootSite ) : SelectionHelper
vwSel IVwSelection The selection to create a SelectionHelper object from or /// null to create it from the given RootSite
rootSite IVwRootSite The root site
Résultat SelectionHelper

GetAssocPrev() public méthode

Indicates whether of not the insertion point should be associated with the characters immediately preceding it in the view (default) or not.
public GetAssocPrev ( SelLimitType type ) : bool
type SelLimitType Which end of the selection
Résultat bool

GetCurrSelectionProps() public méthode

Gets the selection props for the current selection
public GetCurrSelectionProps ( ITsTextProps &vttp, IVwPropertyStore &vvps ) : void
vttp ITsTextProps Returned array of ITsTextProps in the selection
vvps IVwPropertyStore Returned array of IVwPropertyStores in the selection
Résultat void

GetFirstWsOfSelection() public static méthode

Retrieve the first language writing system used by the given selection.
ENHANCE JohnT: Should this be a COM method for IVwSelection?
public static GetFirstWsOfSelection ( IVwSelection vwsel ) : int
vwsel IVwSelection The selection
Résultat int

GetHardAndSoftCharProps() public static méthode

This is like GetSelectionProps, except that the vvpsSoft items include all formatting MINUS the hard formatting in the text properties (ie, those derived by the view constructor and styles).
public static GetHardAndSoftCharProps ( IVwSelection vwSel, ITsTextProps &vttp, IVwPropertyStore &vvpsSoft, int &cttp ) : void
vwSel IVwSelection The view Selection
vttp ITsTextProps Returned array of ITsTextProps in the selection
vvpsSoft IVwPropertyStore Returned array of IVwPropertyStores in the selection
cttp int Returned count of properties
Résultat void

GetIch() public méthode

Gets the 0-based index of the character for the given limit of the selection.
public GetIch ( SelLimitType type ) : int
type SelLimitType
Résultat int

GetIhvoRoot() public méthode

Gets the index of the root object for the given limit of the selection. This is 0 for views that don't display mutliple root objects).
public GetIhvoRoot ( SelLimitType type ) : int
type SelLimitType Anchor or End
Résultat int

GetLevelForTag() public méthode

Returns the level number of the specified tag for this selection. NOTE: This version only searches the anchor for the specified tag.
public GetLevelForTag ( int tag ) : int
tag int The field tag to search for /// (i.e. BaseStText.StTextTags.kflidParagraphs)
Résultat int

GetLevelForTag() public méthode

Returns the level number of the specified tag for this selection.
public GetLevelForTag ( int tag, SelLimitType limitType ) : int
tag int The field tag to search for /// (i.e. BaseStText.StTextTags.kflidParagraphs)
limitType SelLimitType The limit of the selection to search for the specified tag ///
Résultat int

GetLevelInfo() public méthode

Gets the array of VwSelLevInfo. Array elements should indicate the chain of objects that needs to be traversed to get from the root object to object where the selection is to be made. The tag for item n should be the flid in which the children of the root object are owned. The 0th element of this array must have its tag value set to BaseStText.StTextTags.kflidParagraphs. This is set automatically whenever the array is resized using Cvsli.
public GetLevelInfo ( SelLimitType type ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]
type SelLimitType type
Résultat SIL.FieldWorks.Common.COMInterfaces.SelLevInfo[]

GetLevelInfoForTag() public méthode

Returns the selection level info for the specified tag found in the level info for this selection. NOTE: This version only searches the anchor for the specified tag.
Thrown if the specified tag is not found in the level /// info for the Anchor of the selection
public GetLevelInfoForTag ( int tag ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo
tag int The field tag to search for /// (i.e. BaseStText.StTextTags.kflidParagraphs)
Résultat SIL.FieldWorks.Common.COMInterfaces.SelLevInfo

GetLevelInfoForTag() public méthode

Returns the selection level info for the specified tag found in the level info for this selection.
Thrown if the specified tag is not found in the level /// info of the selection
public GetLevelInfoForTag ( int tag, SelLimitType limitType ) : SIL.FieldWorks.Common.COMInterfaces.SelLevInfo
tag int The field tag to search for /// (i.e. BaseStText.StTextTags.kflidParagraphs)
limitType SelLimitType The limit of the selection to search for the specified tag ///
Résultat SIL.FieldWorks.Common.COMInterfaces.SelLevInfo

GetLevelInfoForTag() public méthode

Retrieves the selection level info for the specified tag found in the level info for this selection. NOTE: This version only searches the anchor for the specified tag.
public GetLevelInfoForTag ( int tag, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo &selLevInfo ) : bool
tag int The field tag to search for /// (i.e. BaseStText.StTextTags.kflidParagraphs)
selLevInfo SIL.FieldWorks.Common.COMInterfaces.SelLevInfo The level info for the specified tag, if found; undefined /// otherwise
Résultat bool

GetLevelInfoForTag() public méthode

Retrieves the selection level info for the specified tag found in the level info for this selection.
public GetLevelInfoForTag ( int tag, SelLimitType limitType, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo &selLevInfo ) : bool
tag int The field tag to search for /// (i.e. BaseStText.StTextTags.kflidParagraphs)
limitType SelLimitType The limit of the selection to search for the specified tag ///
selLevInfo SIL.FieldWorks.Common.COMInterfaces.SelLevInfo The level info for the specified tag, if found; undefined /// otherwise
Résultat bool

GetLocation() public méthode

Get the location of the selection TODO: Make this work in PrintLayout view
public GetLocation ( ) : Point
Résultat Point

GetNumberOfLevels() public méthode

Gets the number of levels needed to traverse the view objects to reach the given limit of the selection.
public GetNumberOfLevels ( SelLimitType type ) : int
type SelLimitType
Résultat int

GetNumberOfPreviousProps() public méthode

Gets the number of previous elements for the given limit of the selection
public GetNumberOfPreviousProps ( SelLimitType type ) : int
type SelLimitType Anchor or End
Résultat int

GetParaProps() public static méthode

Gets the paragraph properties for the specified IVwSelection
public static GetParaProps ( IVwSelection vwSel, IVwPropertyStore &vvps, int &cvps ) : void
vwSel IVwSelection The view Selection
vvps IVwPropertyStore Returned array of IVwPropertyStores in the selection
cvps int Returned count of IVwPropertyStores
Résultat void

GetSelProps() public méthode

Get the text props associated with the given end of the selection.
public GetSelProps ( SelLimitType type ) : ITsTextProps
type SelLimitType Which end of the selection
Résultat ITsTextProps

GetSelectionInfo() public static méthode

Gets all information about a selection by calling IVwSelection.AllTextSelInfo.
public static GetSelectionInfo ( IVwSelection vwSel, IVwRootSite rootSite ) : SelectionHelper
vwSel IVwSelection The selection to get info for, or null to get current /// selection.
rootSite IVwRootSite The root site
Résultat SelectionHelper

GetTextPropId() public méthode

Gets the text property that occurs at the indicated end of the selection.
public GetTextPropId ( SelLimitType type ) : int
type SelLimitType
Résultat int

GetTss() public méthode

Get the TsString of the property where the given selection limit is located. This gets the entire TSS of the paragraph, not just the selected portion.
public GetTss ( SelLimitType limit ) : ITsString
limit SelLimitType the part of the selection where tss is to be retrieved (top, /// bottom, end, anchor)
Résultat ITsString

GetWritingSystem() public méthode

Get the writing system associated with the insertion point.

Note: If you need the writing system for the selection, you should use GetFirstWsOfSelection.

public GetWritingSystem ( SelLimitType type ) : int
type SelLimitType Which end of the selection
Résultat int

GetWsOfEntireSelection() public static méthode

Retrieve the language writing system used by the given selection. If the selection has no writing system or contains more than one writing system, zero is returned.
ENHANCE JohnT (DaveO): This should this be a COM method for IVwSelection
public static GetWsOfEntireSelection ( IVwSelection vwsel ) : int
vwsel IVwSelection The selection
Résultat int

InsertLevel() public méthode

Appends a selection level for the specified tag.
public InsertLevel ( int iLev, int tag, int ihvo, int ws ) : void
iLev int Index at which the level is to be inserted.
tag int The tag.
ihvo int The index of the object to insert in the appended level
ws int HVO of the writing system, if the property is a Multitext
Résultat void

IsEditable() public static méthode

Determine if text that belongs to ttp and vps is editable.
public static IsEditable ( ITsTextProps ttp, IVwPropertyStore vps ) : bool
ttp ITsTextProps
vps IVwPropertyStore
Résultat bool

IsEditable() public static méthode

Determine if selection is editable
public static IsEditable ( IVwSelection sel ) : bool
sel IVwSelection Selection
Résultat bool

IsFlidInLevelInfo() public méthode

Determines whether the specified flid is located in the level info for the selection
public IsFlidInLevelInfo ( int flid, SelLimitType limitType ) : bool
flid int The flid.
limitType SelLimitType Type of the limit.
Résultat bool

MakeBest() public méthode

The requested anchor and endpoint may be beyond the end of the string. Try to make a selection as near the end of the string as possible.
public MakeBest ( IVwRootSite rootsite, bool fMakeVisible ) : IVwSelection
rootsite IVwRootSite The rootsite that will try take the selection
fMakeVisible bool Indicates whether to scroll the selection into view ///
Résultat IVwSelection

MakeBest() public méthode

The requested anchor and endpoint may be beyond the end of the string. Try to make a selection as near the end of the string as possible.
public MakeBest ( bool fMakeVisible ) : IVwSelection
fMakeVisible bool Indicates whether to scroll the selection into view ///
Résultat IVwSelection

MakeRangeSelection() public méthode

Make a range selection based upon our saved selection info. NOTE: Installing the selection may trigger side effects that will invalidate the selection. Callers should check to make sure the selection is still valid before using it.
throws if unable to make an end selection
public MakeRangeSelection ( IVwRootBox rootBox, bool fInstall ) : IVwSelection
rootBox IVwRootBox
fInstall bool
Résultat IVwSelection

ReduceSelectionToIp() public static méthode

Reduce a range selection to a simple insertion point, specifying which limit of the range selection to use as the position for the new IP.
public static ReduceSelectionToIp ( IVwRootSite rootSite, SelLimitType limit, bool fMakeVisible ) : SelectionHelper
rootSite IVwRootSite The root site
limit SelLimitType Specify Top to place the IP at the top-most limit of the /// selection. Specify Bottom to place the IP at the bottom-most limit of the selection. /// Specify Anchor to place the IP at the point where the user initiated the selection. /// Specify End to place the IP at the point where the user completed the selection. Be /// aware the user may select text in either direction, thus the end of the selection\ /// could be visually before the anchor. For a simple insertion point or a selection /// entirely within a single StText, this parameter doesn't actually make any /// difference.
fMakeVisible bool Indicates whether to scroll the IP into view.
Résultat SelectionHelper

ReduceSelectionToIp() public static méthode

Reduce a range selection to a simple insertion point, specifying which limit of the range selection to use as the position for the new IP.
public static ReduceSelectionToIp ( IVwRootSite rootSite, SelLimitType limit, bool fMakeVisible, bool fInstall ) : SelectionHelper
rootSite IVwRootSite The root site
limit SelLimitType Specify Top to place the IP at the top-most limit of the /// selection. Specify Bottom to place the IP at the bottom-most limit of the selection. /// Specify Anchor to place the IP at the point where the user initiated the selection. /// Specify End to place the IP at the point where the user completed the selection. Be /// aware the user may select text in either direction, thus the end of the selection\ /// could be visually before the anchor. For a simple insertion point or a selection /// entirely within a single StText, this parameter doesn't actually make any /// difference.
fMakeVisible bool Indicates whether to scroll the IP into view.
fInstall bool True to install the created selection, false otherwise
Résultat SelectionHelper

ReduceSelectionToIp() public méthode

Gets a (new) selection helper that represents an insertion point at the specified limit of this selection
public ReduceSelectionToIp ( SelLimitType limit, bool fMakeVisible, bool fInstall ) : SelectionHelper
limit SelLimitType Specify Top to place the IP at the top-most limit of the /// selection. Specify Bottom to place the IP at the bottom-most limit of the selection. /// Specify Anchor to place the IP at the point where the user initiated the selection. /// Specify End to place the IP at the point where the user completed the selection. Be /// aware the user may select text in either direction, thus the end of the selection\ /// could be visually before the anchor. For a simple insertion point or a selection /// entirely within a single StText, this parameter doesn't actually make any /// difference.
fMakeVisible bool Indicates whether to scroll the IP into view.
fInstall bool True to install the created selection, false otherwise
Résultat SelectionHelper

ReduceToIp() public méthode

This is the workhorse that actually reduces a range selection to a simple insertion point, given the specified index to indicate the limit where the IP is to be created.
public ReduceToIp ( SelLimitType limit, bool fMakeVisible, bool fInstall ) : IVwSelection
limit SelLimitType The current selection limit to reduce to
fMakeVisible bool Indicates whether to scroll the IP into view.
fInstall bool True to install the created selection, false otherwise
Résultat IVwSelection

ReduceToIp() public méthode

Reduces this selection to an insertion point at the specified limit. Will not install or make visible.
public ReduceToIp ( SelLimitType limit ) : void
limit SelLimitType The current selection limit to reduce to
Résultat void

RemoveLevel() public méthode

Removes the selection level for the specified tag.
public RemoveLevel ( int tag ) : void
tag int The tag.
Résultat void

RemoveLevelAt() public méthode

Remove the specified level from the SelLevInfo for both ends.
public RemoveLevelAt ( int ilev ) : void
ilev int
Résultat void

RestoreScrollPos() public méthode

Scrolls the selection to its original scroll position.
public RestoreScrollPos ( ) : void
Résultat void

RestoreSelectionAndScrollPos() public méthode

Makes a selection then scrolls the window so the IP is at the same vertical position it was when this selection helper object was created. This method is used mainly after reconstructing a view. After reconstruction, the desire is to not only have the IP back in the data where it was before reconstruction, but to have the same number of pixels between the IP and the top of the view. This method does it's best to do this.
public RestoreSelectionAndScrollPos ( ) : bool
Résultat bool

SelectionHelper() public méthode

The default constructor must be followed by a call to SetSelection before it will really be useful
public SelectionHelper ( ) : System
Résultat System

SelectionHelper() protected méthode

Create a selection helper based on an existing selection
protected SelectionHelper ( IVwSelection vwSel, IVwRootSite rootSite ) : System
vwSel IVwSelection
rootSite IVwRootSite
Résultat System

SelectionHelper() public méthode

Copy constructor
public SelectionHelper ( SelectionHelper src ) : System
src SelectionHelper The source object
Résultat System

SetAssocPrev() public méthode

Indicates whether of not the insertion point should be associated with the characters immediately preceding it in the view (default) or not.
public SetAssocPrev ( SelLimitType type, bool value ) : void
type SelLimitType Which end of the selection
value bool true to associate IP with preceding characters, otherwise /// false
Résultat void

SetIPAfterUOW() public méthode

Make an insertion point based upon our saved anchor selection info. It will not be set until after the unit of work.
public SetIPAfterUOW ( ) : void
Résultat void

SetIPAfterUOW() public méthode

Make an insertion point based upon our saved anchor selection info. It will not be set until after the unit of work.
public SetIPAfterUOW ( IVwRootSite rootSite ) : void
rootSite IVwRootSite
Résultat void

SetIch() public méthode

Sets the 0-based index of the character for the given limit of the selection. If appropriate records that the end of the selection has been set explicitly.
public SetIch ( SelLimitType type, int value ) : void
type SelLimitType
value int
Résultat void

SetIhvoRoot() public méthode

Sets the index of the root object for the given limit of the selection. This is 0 for views that don't display mutliple root objects).
public SetIhvoRoot ( SelLimitType type, int value ) : void
type SelLimitType
value int
Résultat void

SetLevelInfo() public méthode

Sets the array of SelLevInfo.
public SetLevelInfo ( SelLimitType type, SIL.FieldWorks.Common.COMInterfaces.SelLevInfo value ) : void
type SelLimitType type
value SIL.FieldWorks.Common.COMInterfaces.SelLevInfo The level info
Résultat void

SetNumberOfLevels() public méthode

Sets the number of levels needed to traverse the view objects to reach the given limit of the selection.
public SetNumberOfLevels ( SelLimitType type, int value ) : void
type SelLimitType
value int
Résultat void

SetNumberOfPreviousProps() public méthode

Sets the number of previous elements for the given limit of the selection
public SetNumberOfPreviousProps ( SelLimitType type, int value ) : void
type SelLimitType
value int
Résultat void

SetSelProps() public méthode

Set the text props associated with the given end of the selection.
public SetSelProps ( SelLimitType type, ITsTextProps value ) : void
type SelLimitType Which end of the selection
value ITsTextProps Properties to set for the selection
Résultat void

SetSelection() public méthode

Sets the selection
public SetSelection ( IVwRootSite rootSite ) : IVwSelection
rootSite IVwRootSite The root site
Résultat IVwSelection

SetSelection() public méthode

Sets the selection by calling IVwRootBox.MakeRangeSelection.
public SetSelection ( IVwRootSite rootSite, bool fInstall, bool fMakeVisible ) : IVwSelection
rootSite IVwRootSite The root site
fInstall bool Makes the selection the current selection
fMakeVisible bool Determines whether or not to make the selection visible. ///
Résultat IVwSelection

SetSelection() public méthode

Sets the selection by calling IVwRootBox.MakeRangeSelection.
public SetSelection ( IVwRootSite rootSite, bool fInstall, bool fMakeVisible, VwScrollSelOpts scrollOption ) : IVwSelection
rootSite IVwRootSite The root site
fInstall bool Makes the selection the current selection
fMakeVisible bool Determines whether or not to make the selection visible. ///
scrollOption VwScrollSelOpts Where to scroll the selection
Résultat IVwSelection

SetSelection() public méthode

Sets and install the selection in the previously supplied rootsite.
public SetSelection ( bool fMakeVisible ) : IVwSelection
fMakeVisible bool Indicates whether to scroll the selection into view ///
Résultat IVwSelection

SetSelection() public méthode

Sets the selection by calling IVwRootBox.MakeRangeSelection.
public SetSelection ( bool fInstall, bool fMakeVisible ) : IVwSelection
fInstall bool Makes the selection the current selection
fMakeVisible bool Determines whether or not to make the selection visible. ///
Résultat IVwSelection

SetTextPropId() public méthode

Sets the text property that occurs at the indicated end of the selection.
public SetTextPropId ( SelLimitType type, int tagTextProp ) : void
type SelLimitType Anchor or End
tagTextProp int Text property
Résultat void

SetWritingSystem() public méthode

Set the writing system associated with the insertion point.

Note: If you need the writing system for the selection, you should use GetFirstWsOfSelection.

public SetWritingSystem ( SelLimitType type, int value ) : void
type SelLimitType Which end of the selection
value int Writing system
Résultat void

UpdateScrollLocation() public méthode

Updates the internal scroll location for this selection to be up-to-date, if possible.
public UpdateScrollLocation ( ) : void
Résultat void

Property Details

s_mockedSelectionHelper public_oe static_oe property

Used for testing: holds SelectionHelper mock
public static SelectionHelper,SIL.FieldWorks.Common.RootSites s_mockedSelectionHelper
Résultat SelectionHelper