C# Class SIL.FieldWorks.FwCoreDlgs.FindCollectorEnv

Handles finding text
The current implementation doesn't work for different styles, tags, and WSs that are applied by the VC.
Inheritance: FindReplaceCollectorEnvBase
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_LimitLocation LocationInfo
m_LocationFound LocationInfo
m_StartLocation LocationInfo
m_fHaveWrapped bool
m_fHitLimit bool

Public Methods

Method Description
AddString ( ITsString tss ) : void

Adds the string. Overridden to check for strings that were added inside of an open property.

AddStringAltMember ( int tag, int ws, IVwViewConstructor _vwvc ) : void

Member AddStringAltMember

AddStringProp ( int tag, IVwViewConstructor _vwvc ) : void

Member AddStringProp

FindCollectorEnv ( IVwViewConstructor vc, ISilDataAccess sda, int hvoRoot, int frag, IVwPattern vwPattern, IVwSearchKiller searchKiller ) : System

Initializes a new instance of the T:FindCollectorEnv class.

If the base environment is not null, it is used for various things, such as obtaining 'outer object' information.

FindNext ( LocationInfo startLocation ) : LocationInfo

Finds the next occurence.

Protected Methods

Method Description
CheckForNonPropInfo ( ) : void

Override to check whether the start location or the limit location is in a literal string or some other added property.

CheckForStartLocationAndLimit ( int tag ) : void

Checks to see if the current location is the starting location. It will also check to see if the current location is the limit (or passed the limit). NOTE: This method doesn't check any character position as it should only be used for properties that won't be searched (i.e. that the find will skip over)

CurrentLocationIsStartLocation ( int tag ) : bool

Returns whether or not the property at the current location is the starting location. NOTE: This method will return false if there is no start location

CurrentStackIsSameAsLocationInfo ( LocationInfo info, int tag ) : bool

Determines if the current stack loacation and the specified tag match the location specified in the given LocationInfo

DisplayThisObject ( int hvoItem, int tag ) : bool

Determines whether to search this object based on whether we've reached our start location yet.

DoFind ( ITsString tss, int tag ) : void

Does the find.

PassedLimit ( int tag, int testIch ) : bool

Check to see whether we have passed the limit so we can stop searching and not just go on and on endlessly in an infinite loop forever and ever until the user gets fed up and throws the computer out the window.

Method Details

AddString() public method

Adds the string. Overridden to check for strings that were added inside of an open property.
public AddString ( ITsString tss ) : void
tss ITsString The TSS.
return void

AddStringAltMember() public method

Member AddStringAltMember
public AddStringAltMember ( int tag, int ws, IVwViewConstructor _vwvc ) : void
tag int tag
ws int ws
_vwvc IVwViewConstructor _vwvc
return void

AddStringProp() public method

Member AddStringProp
public AddStringProp ( int tag, IVwViewConstructor _vwvc ) : void
tag int tag
_vwvc IVwViewConstructor _vwvc
return void

CheckForNonPropInfo() protected method

Override to check whether the start location or the limit location is in a literal string or some other added property.
protected CheckForNonPropInfo ( ) : void
return void

CheckForStartLocationAndLimit() protected method

Checks to see if the current location is the starting location. It will also check to see if the current location is the limit (or passed the limit). NOTE: This method doesn't check any character position as it should only be used for properties that won't be searched (i.e. that the find will skip over)
protected CheckForStartLocationAndLimit ( int tag ) : void
tag int The tag of the current object.
return void

CurrentLocationIsStartLocation() protected method

Returns whether or not the property at the current location is the starting location. NOTE: This method will return false if there is no start location
protected CurrentLocationIsStartLocation ( int tag ) : bool
tag int The tag of the property.
return bool

CurrentStackIsSameAsLocationInfo() protected method

Determines if the current stack loacation and the specified tag match the location specified in the given LocationInfo
protected CurrentStackIsSameAsLocationInfo ( LocationInfo info, int tag ) : bool
info LocationInfo The LocationInfo to check.
tag int The tag of the current property.
return bool

DisplayThisObject() protected method

Determines whether to search this object based on whether we've reached our start location yet.
protected DisplayThisObject ( int hvoItem, int tag ) : bool
hvoItem int The hvo item.
tag int The tag.
return bool

DoFind() protected method

Does the find.
protected DoFind ( ITsString tss, int tag ) : void
tss ITsString The original string.
tag int Tag
return void

FindCollectorEnv() public method

Initializes a new instance of the T:FindCollectorEnv class.
If the base environment is not null, it is used for various things, such as obtaining 'outer object' information.
public FindCollectorEnv ( IVwViewConstructor vc, ISilDataAccess sda, int hvoRoot, int frag, IVwPattern vwPattern, IVwSearchKiller searchKiller ) : System
vc IVwViewConstructor The view constructor.
sda ISilDataAccess Date access to get prop values etc.
hvoRoot int The root object to display.
frag int The fragment.
vwPattern IVwPattern The find/replace pattern.
searchKiller IVwSearchKiller Used to interrupt a find/replace
return System

FindNext() public method

Finds the next occurence.
public FindNext ( LocationInfo startLocation ) : LocationInfo
startLocation LocationInfo The selection level information, property tag and /// character offset that represent the location where the search should start.
return LocationInfo

PassedLimit() protected method

Check to see whether we have passed the limit so we can stop searching and not just go on and on endlessly in an infinite loop forever and ever until the user gets fed up and throws the computer out the window.
protected PassedLimit ( int tag, int testIch ) : bool
tag int The tag of the property whose string is being searched
testIch int The character offset position being tested. May be -1 if /// no match was found in this string, in which case we treat it as being beyond the /// limit if this string is the string that contains the limit.
return bool

Property Details

m_LimitLocation protected_oe property

Location where find next should stop because it has wrapped around
protected LocationInfo m_LimitLocation
return LocationInfo

m_LocationFound protected_oe property

Found match location
protected LocationInfo m_LocationFound
return LocationInfo

m_StartLocation protected_oe property

Location to start current find next
protected LocationInfo m_StartLocation
return LocationInfo

m_fHaveWrapped protected_oe property

True if the find has already wrapped, false otherwise
protected bool m_fHaveWrapped
return bool

m_fHitLimit protected_oe property

True if we have passed the limit, false otherwise
protected bool m_fHitLimit
return bool