←Select platform

DocumentViewerFindTextStart Enumeration

Summary

An enumeration for choosing the start position of a DocumentViewerText.Find operation.

Syntax

C#
VB
C++
public enum DocumentViewerFindTextStart 
Public Enum DocumentViewerFindTextStart 
public: 
   enum class DocumentViewerFindTextStart sealed 

Members

ValueMemberDescription
0BeginPositionDefault. Indicates that the search should run from the provided DocumentViewerFindText.BeginPosition to the DocumentViewerFindText.EndPosition (or top of page 1 and bottom of the last page, if these values were null). This results in one total search from begin to end.
1InSelectionSetting this value to DocumentViewerFindText.Start indicates that the search should begin at the first character inside the first text selection in the document. This position may be either DocumentViewerText.SelectedTextBegin or DocumentViewerText.SelectedTextEnd, depending on the direction of the search.

If no text is selected, DocumentViewerFindText.Start works like DocumentViewerFindTextStart.BeginPosition (the default).

If the text selection is within the bounds created by DocumentViewerFindText.BeginPosition and DocumentViewerFindText.EndPosition, this may result in two searches.

The first search will occur from the first character in the selection to the position indicated by DocumentViewerFindText.EndPosition. If the first character in the selection is before the beginPosition in the direction of the search, this means only one search is conducted, from the beginPosition to the endPosition. If the first character in the selection is after the endPosition in the direction of the search, no results will be returned.

If DocumentViewerFindText.Loop or DocumentViewerFindText.FindAll is set to true, then a second search may be conducted from the beginPosition to the character before the first character in the selection, provided that the first character in the selection was within the bounds of the search.

This behavior is similar to that in DocumentViewerFindTextStart.AfterSelection, but with the first character in the text selection instead of the character after the end of the selection. Effectively, DocumentViewerFindTextStart.InSelection will search the selection first, and DocumentViewerFindTextStart.AfterSelection will not.

When using DocumentViewerFindText.SelectFirstResult, searching from the first character of the selection may be useful for “live update” search actions that will continue to add on to the selected text as long as it continues to match DocumentViewerFindText.Text. For example, if “L” is the selected text from a previous search for “L”, and the rest of the text is -“ead”, then successive searches of “L”, “Le”, “Lea”, and “Lead” will add to the selected item instead of searching for a new match each time.
2AfterSelectionSetting this value to DocumentViewerFindText.Start indicates that the search should begin at the first character after the last text selection in the document. This position may be one character before or after DocumentViewerText.SelectedTextBegin or DocumentViewerText.SelectedTextEnd, depending on the direction of the search. If the search is forward / down the page, the start will be the character after DocumentViewerText.SelectedTextEnd; if the search is backward / up the page, the start will be the character before DocumentViewerText.SelectedTextBegin.

If no text is selected, DocumentViewerFindText.Start works like FindTextStart.BeginPosition (the default).

If the text selection is within the bounds created by DocumentViewerFindText.BeginPosition and DocumentViewerFindText.EndPosition, this may result in two searches.

The first search will occur from the start point mentioned above to the position indicated by DocumentViewerFindText.EndPosition. If the start position is before the beginPosition in the direction of the search, this means only one search is conducted, from the beginPosition to the endPosition. If the start position is after the endPosition in the direction of the search, no results will be returned.

If DocumentViewerFindText.Loop or DocumentViewerFindText.FindAll is set to true, then a second search may be conducted from the beginPosition to the character before the start point, provided that the start point was within the bounds of the search as described above.

This behavior is similar to that in DocumentViewerFindTextStart.InSelection, but with the first character after the text selection instead of the character inside the selection. Effectively, DocumentViewerFindTextStart.InSelection will search the selection first, and DocumentViewerFindTextStart.AfterSelection will not.

When using DocumentViewerFindText.SelectFirstResult, searching from the first character after the selection is useful for “Find Next” and “Find Previous” operations that cycle through all the matches in the bounds.
3ManualPositionIndicates that the search should start from DocumentViewerFindText.ManualStartPosition.

If this value is provided to DocumentViewerFindText.Start, the search operation will use the value of DocumentViewerFindText.ManualStartPosition as the start point. If DocumentViewerFindText.ManualStartPosition is null, the search will act as if DocumentViewerFindText.BeginPosition was passed to DocumentViewerFindText.Start instead.

See DocumentViewerFindText.ManualStartPosition for more information.
Remarks

DocumentViewerFindTextStart is an enum type that chooses where the DocumentViewerText.Find method will start its search within the provided begin and end parameters. While the DocumentViewerFindText.BeginPosition and DocumentViewerFindText.EndPosition properties specify the bounds of the search, it is the DocumentViewerFindText.Start that determines where the algorithm will begin searching.

If DocumentViewerFindText.Loop or DocumentViewerFindText.FindAll is true, then the text search operation will be cut into two parts – one search from the start to the endPosition, and another from the beginPosition to the character before the start.

History

19.0.0.49
Added
Example

For an example, see DocumentViewerText.Find.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents.UI.WinForms Assembly