Skip to content

Commit 0a6971e

Browse files
authored
line length corrected
1 parent e66ba7a commit 0a6971e

1 file changed

Lines changed: 33 additions & 19 deletions

File tree

FindOnPage.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
## Background
44

5-
The WebView2Find API provides methods and events to support text finding and navigation within a WebView2 control.
6-
It allows developers to programmatically initiate find operations, navigate between find results, supress default UI, customize various find configurations
7-
such as query, direction of search, match case, match word, etc. Also enables developers to track the status of ongoing operations such as whether a find session has
8-
completed or not, whether the match count has changed, and whether the match index has changed.
5+
The WebView2Find API offers methods and events for text finding and navigation
6+
within a WebView2 control. It enables developers to programmatically initiate find
7+
operations, navigate find results, suppress default UI, and customize find configurations
8+
like query and search direction. It also tracks the status of operations, indicating
9+
completion, match count changes, and match index changes.
910

1011
## Examples
1112

1213

1314
#### Description
14-
To initiate a find operation within a WebView2 control, developers can utilize the `StartFind` method.
15-
This method allows specifying the find term and configuring other find parameters using the `ICoreWebView2FindConfiguration` interface.
16-
Additionally there can only be one find session active per webview environment.
17-
If an attempt is made to call start find more than once with the same findconfugration,
18-
it will result in the active match index either being increased or decreased depending on what
19-
Find Direction parameter was chosen for the Find Configuration.
2015

16+
To initiate a find operation in a WebView2 control, use the `StartFind` method.
17+
This method allows setting the search term and find parameters via the
18+
`ICoreWebView2FindConfiguration` interface. Only one find session can be active per
19+
webview environment. Starting another with the same configuration will adjust
20+
the active match index based on the selected Find Direction.
2121
#### Create/Specify a Find Configuration
2222
```cpp
2323

@@ -124,7 +124,8 @@ async void ConfigureAndExecuteFindAsync(string searchTerm){
124124
### Retrieve the Number of Matches
125125

126126
#### Description
127-
To retrieve the total number of matches found during a find operation within a WebView2 control, developers can utilize the `GetMatchCount` method.
127+
To retrieve the total number of matches found during a find operation
128+
within a WebView2 control, developers can utilize the `GetMatchCount` method.
128129

129130

130131
```cpp
@@ -152,7 +153,8 @@ To retrieve the total number of matches found during a find operation within a W
152153
//! [GetMatchCount]
153154
public async Task<int> GetMatchCountAsync()
154155
{
155-
var webViewFind = webView.CoreWebView2.FindController; // Assuming webView is your WebView2 control
156+
// Assuming webView is your WebView2 control
157+
var webViewFind = webView.CoreWebView2.FindController;
156158
var matchCount = await webViewFind.GetMatchesCountAsync();
157159
MessageBox.Show($"Match Count: {matchCount}", "Find Operation", MessageBoxButton.OK);
158160
return matchCount;
@@ -210,7 +212,8 @@ void ActiveMatchIndexChangedSample()
210212
### Retrieve the Index of the Active Match
211213

212214
#### Description
213-
Developers can retrieve the index of the currently active match within a WebView2 control using the `GetActiveMatchIndex` method.
215+
Developers can retrieve the index of the currently active match
216+
within a WebView2 control using the `GetActiveMatchIndex` method.
214217

215218

216219
```cpp
@@ -372,7 +375,11 @@ interface ICoreWebView2Find : IUnknown {
372375

373376
### Setting Up Find Configuration with MIDL3
374377

375-
To represent the given C# examples in a manner consistent with the behavior demonstrated earlier in the chat and align them with an API design that could be described using MIDL3 (noted as C# for formatting), let's formalize the design for a hypothetical WebView2 Find operation API. This design will incorporate setting up a find configuration, starting a find operation, handling find operation events, and navigating through find matches.
378+
To represent the given C# examples in a manner consistent with the behavior demonstrated
379+
earlier in the chat and align them with an API design that could be described using
380+
MIDL3 (noted as C# for formatting), let's formalize the design for a hypothetical
381+
WebView2 Find operation API. This design will incorporate setting up a find configuration,
382+
starting a find operation, handling find operation events, and navigating through find matches.
376383

377384
### CoreWebView2 Find Configuration and Direction
378385

@@ -440,13 +447,20 @@ namespace Microsoft.Web.WebView2.Core
440447
}
441448
```
442449

443-
These examples demonstrate how you would conceptualize and implement the Find API within the Microsoft WebView2 environment, focusing on async patterns for responsive UI interactions and event handling for dynamic UI updates based on the results of find operations.
444-
This design emphasizes asynchronous task-based APIs, event handling for UI updates, and modular API design for clear separation of concerns.
450+
These examples demonstrate how you would conceptualize and implement the Find API
451+
within the Microsoft WebView2 environment, focusing on async patterns for
452+
responsive UI interactions and event handling for dynamic UI updates based on the
453+
results of find operations. This design emphasizes asynchronous task-based APIs,
454+
event handling for UI updates, and modular API design for clear separation of concerns.
445455

446456
# Appendix
447457

448-
This API specification focuses on providing developers with the necessary information to integrate text finding and navigation functionalities into WebView2 applications.
449-
It emphasizes the usage of interfaces such as `ICoreWebView2Find` and `ICoreWebView2FindConfiguration` to perform find operations effectively.
458+
This API specification focuses on providing developers with the necessary information
459+
to integrate text finding and navigation functionalities into WebView2 applications.
460+
It emphasizes the usage of interfaces such as `ICoreWebView2Find` and
461+
`ICoreWebView2FindConfiguration` to perform find operations effectively.
462+
450463
Additional Info:
451-
Starting a find session when one is in progress will result in the active match index being moved forward or backwards depending on what find configuration has been used
464+
Starting a find session when one is in progress will result in the active match index
465+
being moved forward or backwards depending on what find configuration has been used
452466
(forward,backward).

0 commit comments

Comments
 (0)