Skip to content

Commit 746f570

Browse files
committed
WebView2 headers collection pages state 997's enumerator and its four derived classes; FAQ: VBP import carries the startup object, icon form and the console flag
1 parent 3051662 commit 746f570

5 files changed

Lines changed: 22 additions & 12 deletions

File tree

‎docs/Miscellaneous/FAQs.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ You can import individual files, from VB projects or any type, through the Impor
248248
> You can select .bas/.cls files individually, but to import Forms, UserControls, Property Pages, and Resource Files you must currently select the .vbp file they're associated with. You'll then be shown a list of files you can import (with their new twinBASIC extensions .tbform/.twin etc-- make sure to import both, e.g. for Form1.frm you'll see Form1.frm.tbform and Form1.frm.twin:
249249
250250
![The Import from twinproj dialog: a tick-box tree of everything found in RunAsTI.vbp, with the Resources branch expanded over its ICON and MANIFEST folders and a Sources branch below. Form1.frm.tbform and Form1.frm.twin are both ticked.](Images/16833fae-4bd7-418f-bb16-691a611a5b01.png){:style="width:50%; height:auto;"}
251+
252+
Importing a .vbp also carries over its [startup object](tB/IDE/Project/Settings#startup-object) and its [icon form](tB/IDE/Project/Settings#icon-form). A VB6 project that was linked as a console program --- its `LinkSwitches` line contains `/SUBSYSTEM:CONSOLE`, written in capitals --- becomes a [console application](tB/IDE/Project/Settings#is-console-application). No other linker switch is carried over.
251253
</details>
252254

253255
<details>

‎docs/Reference/Built-In/WebView2/WebView2HeadersCollection.md‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ has_toc: false
1010

1111
An enumerator that yields [**WebView2Header**](WebView2Header) values one by one. Returned by **WebView2RequestHeaders.GetHeaders**, **WebView2ResponseHeaders.GetHeaders**, and by `For Each` over a [**WebView2RequestHeaders**](WebView2RequestHeaders) or [**WebView2ResponseHeaders**](WebView2ResponseHeaders) instance.
1212

13-
The collection is forward-only: once iterated it is exhausted. It does not implement **Reset**, **Skip**, or **Clone**, and calling those raises run-time error 80004001 (*Not implemented*).
13+
The collection implements the COM enumerator operations **Next**, **Skip**, **Reset** and **Clone**, which `For Each` and other COM enumerator clients call. They are not members that BASIC code can call. A loop reads the headers once, front to back; **Reset** starts the enumeration again from the first header. Every call to **GetHeaders** and every `For Each` loop produces a new enumerator, so a new loop always starts at the first header.
14+
15+
A **WebView2HeadersCollection** is never created by application code. The package returns one of the four derived classes listed under [Derived classes](#derived-classes), typed as **WebView2HeadersCollection**.
1416

1517
```tb check_build
1618
Private Sub WebView21_NavigationStarting( _
@@ -27,14 +29,20 @@ Private Sub WebView21_NavigationStarting( _
2729
End Sub
2830
```
2931

32+
## Derived classes
33+
34+
Four public classes inherit from **WebView2HeadersCollection**. Each is `[COMCreatable(False)]`, and application code does not create them: the package creates them and returns them as **WebView2HeadersCollection**. Each overrides **Reset** and **Clone** to work on its own source of headers.
35+
36+
| Class | Returned by | Yields |
37+
|-------|-------------|--------|
38+
| **WebView2HeadersCollection_RequestGetHeaders** | [**WebView2RequestHeaders.GetHeaders**](WebView2RequestHeaders#getheaders) | the request headers whose name matches the *name* argument |
39+
| **WebView2HeadersCollection_RequestEnumerator** | `For Each` over a [**WebView2RequestHeaders**](WebView2RequestHeaders) | every request header |
40+
| **WebView2HeadersCollection_ResponseGetHeaders** | [**WebView2ResponseHeaders.GetHeaders**](WebView2ResponseHeaders#getheaders) | the response headers whose name matches the *name* argument |
41+
| **WebView2HeadersCollection_ResponseEnumerator** | `For Each` over a [**WebView2ResponseHeaders**](WebView2ResponseHeaders) | every response header |
42+
3043
## Methods
3144

3245
### New
3346
{: .no_toc }
3447

35-
Constructs the collection. Created internally by the package; application code does not normally invoke this.
36-
37-
Syntax: **New WebView2HeadersCollection** ( *Iterator* )
38-
39-
*Iterator*
40-
: *required* An internal iterator handed in by the runtime.
48+
Constructs the collection from the runtime's header iterator. The constructor is **Protected**: only the four derived classes call it, and application code cannot create a **WebView2HeadersCollection**.

‎docs/Reference/Built-In/WebView2/WebView2RequestHeaders.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Syntax: *object*.**GetHeader** ( *name* ) **As String**
6767
### GetHeaders
6868
{: .no_toc }
6969

70-
Returns a [**WebView2HeadersCollection**](WebView2HeadersCollection) iterator restricted to the headers that match *name* --- useful for headers that may have multiple values.
70+
Returns a [**WebView2HeadersCollection**](WebView2HeadersCollection) enumerator restricted to the headers that match *name* --- useful for headers that may have multiple values. Each call returns a new enumerator that starts at the first matching header.
7171

7272
Syntax: *object*.**GetHeaders** ( *name* ) **As WebView2HeadersCollection**
7373

@@ -103,4 +103,4 @@ Private Sub WebView21_NavigationStarting( _
103103
End Sub
104104
```
105105

106-
The enumerator is forward-only and cannot be reset. See [**WebView2HeadersCollection**](WebView2HeadersCollection) for the iteration object.
106+
Each `For Each` loop starts at the first header. See [**WebView2HeadersCollection**](WebView2HeadersCollection) for the iteration object.

‎docs/Reference/Built-In/WebView2/WebView2ResponseHeaders.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Syntax: *object*.**GetHeader** ( *name* ) **As String**
6262
### GetHeaders
6363
{: .no_toc }
6464

65-
Returns a [**WebView2HeadersCollection**](WebView2HeadersCollection) iterator restricted to the headers that match *name*.
65+
Returns a [**WebView2HeadersCollection**](WebView2HeadersCollection) enumerator restricted to the headers that match *name*. Each call returns a new enumerator that starts at the first matching header.
6666

6767
Syntax: *object*.**GetHeaders** ( *name* ) **As WebView2HeadersCollection**
6868

@@ -85,4 +85,4 @@ Private Sub WebView21_WebResourceRequested( _
8585
End Sub
8686
```
8787

88-
See [**WebView2HeadersCollection**](WebView2HeadersCollection) for the iteration object.
88+
Each `For Each` loop starts at the first header. See [**WebView2HeadersCollection**](WebView2HeadersCollection) for the iteration object.

‎docs/Reference/Built-In/WebView2/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Beyond the control itself, the package exposes a small set of wrapper objects th
1919
- [WebView2](WebView2/) -- the control: navigation, scripting, settings, deferral-aware events, and PDF / suspend / download / task-manager features controlled by the underlying Edge runtime
2020
- [WebView2EnvironmentOptions](WebView2/EnvironmentOptions) -- pre-creation configuration for the WebView2 environment (user-data folder, executable folder, locale, tracking-prevention, …); reached via the control's **EnvironmentOptions** property
2121
- [WebView2Header](WebView2Header) -- one HTTP header (Name / Value); the element type yielded by header iteration
22-
- [WebView2HeadersCollection](WebView2HeadersCollection) -- enumerable wrapper used by `For Each` over request / response headers
22+
- [WebView2HeadersCollection](WebView2HeadersCollection) -- enumerator returned by **GetHeaders** and used by `For Each` over request / response headers; also describes its four derived classes
2323
- [WebView2Request](WebView2Request) -- the request side of a **WebResourceRequested** event -- **Method**, **Uri**, **Headers**, and the request body as bytes or UTF-8 text
2424
- [WebView2RequestHeaders](WebView2RequestHeaders) -- mutable request-header collection passed to **NavigationStarting** and reached via **WebView2Request.Headers**
2525
- [WebView2Response](WebView2Response) -- the response side of a **WebResourceRequested** event -- **StatusCode**, **ReasonPhrase**, **Headers**, and the body as bytes or UTF-8 text

0 commit comments

Comments
 (0)