@@ -121,14 +121,9 @@ public Task<HandleUserPromptResult> HandleUserPromptAsync(HandleUserPromptOption
121121 return BiDi . BrowsingContext . HandleUserPromptAsync ( this , options ) ;
122122 }
123123
124- public Task < GetTreeResult > GetTreeAsync ( BrowsingContextGetTreeOptions ? options = null )
124+ public Task < GetTreeResult > GetTreeAsync ( ContextGetTreeOptions ? options = null )
125125 {
126- GetTreeOptions getTreeOptions = new ( options )
127- {
128- Root = this
129- } ;
130-
131- return BiDi . BrowsingContext . GetTreeAsync ( getTreeOptions ) ;
126+ return BiDi . BrowsingContext . GetTreeAsync ( ContextGetTreeOptions . WithContext ( options , this ) ) ;
132127 }
133128
134129 public Task < Subscription > OnNavigationStartedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -139,7 +134,7 @@ public Task<Subscription> OnNavigationStartedAsync(Func<NavigationInfo, Task> ha
139134 {
140135 await handler ( e ) . ConfigureAwait ( false ) ;
141136 }
142- } , options . WithContext ( this ) ) ;
137+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
143138 }
144139
145140 public Task < Subscription > OnNavigationStartedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -150,7 +145,7 @@ public Task<Subscription> OnNavigationStartedAsync(Action<NavigationInfo> handle
150145 {
151146 handler ( e ) ;
152147 }
153- } , options . WithContext ( this ) ) ;
148+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
154149 }
155150
156151 public Task < Subscription > OnFragmentNavigatedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -161,7 +156,7 @@ public Task<Subscription> OnFragmentNavigatedAsync(Func<NavigationInfo, Task> ha
161156 {
162157 await handler ( e ) . ConfigureAwait ( false ) ;
163158 }
164- } , options . WithContext ( this ) ) ;
159+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
165160 }
166161
167162 public Task < Subscription > OnFragmentNavigatedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -172,7 +167,7 @@ public Task<Subscription> OnFragmentNavigatedAsync(Action<NavigationInfo> handle
172167 {
173168 handler ( e ) ;
174169 }
175- } , options . WithContext ( this ) ) ;
170+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
176171 }
177172
178173 public Task < Subscription > OnHistoryUpdatedAsync ( Func < HistoryUpdatedEventArgs , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -183,7 +178,7 @@ public Task<Subscription> OnHistoryUpdatedAsync(Func<HistoryUpdatedEventArgs, Ta
183178 {
184179 await handler ( e ) . ConfigureAwait ( false ) ;
185180 }
186- } , options . WithContext ( this ) ) ;
181+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
187182 }
188183
189184 public Task < Subscription > OnHistoryUpdatedAsync ( Action < HistoryUpdatedEventArgs > handler , ContextSubscriptionOptions ? options = null )
@@ -194,7 +189,7 @@ public Task<Subscription> OnHistoryUpdatedAsync(Action<HistoryUpdatedEventArgs>
194189 {
195190 handler ( e ) ;
196191 }
197- } , options . WithContext ( this ) ) ;
192+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
198193 }
199194
200195 public Task < Subscription > OnDomContentLoadedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -205,7 +200,7 @@ public Task<Subscription> OnDomContentLoadedAsync(Func<NavigationInfo, Task> han
205200 {
206201 await handler ( e ) . ConfigureAwait ( false ) ;
207202 }
208- } , options . WithContext ( this ) ) ;
203+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
209204 }
210205
211206 public Task < Subscription > OnDomContentLoadedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -216,7 +211,7 @@ public Task<Subscription> OnDomContentLoadedAsync(Action<NavigationInfo> handler
216211 {
217212 handler ( e ) ;
218213 }
219- } , options . WithContext ( this ) ) ;
214+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
220215 }
221216
222217 public Task < Subscription > OnLoadAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -227,7 +222,7 @@ public Task<Subscription> OnLoadAsync(Action<NavigationInfo> handler, ContextSub
227222 {
228223 handler ( e ) ;
229224 }
230- } , options . WithContext ( this ) ) ;
225+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
231226 }
232227
233228 public Task < Subscription > OnLoadAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -238,7 +233,7 @@ public Task<Subscription> OnLoadAsync(Func<NavigationInfo, Task> handler, Contex
238233 {
239234 await handler ( e ) . ConfigureAwait ( false ) ;
240235 }
241- } , options . WithContext ( this ) ) ;
236+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
242237 }
243238
244239 public Task < Subscription > OnDownloadWillBeginAsync ( Action < DownloadWillBeginEventArgs > handler , ContextSubscriptionOptions ? options = null )
@@ -249,7 +244,7 @@ public Task<Subscription> OnDownloadWillBeginAsync(Action<DownloadWillBeginEvent
249244 {
250245 handler ( e ) ;
251246 }
252- } , options . WithContext ( this ) ) ;
247+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
253248 }
254249
255250 public Task < Subscription > OnDownloadWillBeginAsync ( Func < DownloadWillBeginEventArgs , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -260,7 +255,7 @@ public Task<Subscription> OnDownloadWillBeginAsync(Func<DownloadWillBeginEventAr
260255 {
261256 await handler ( e ) . ConfigureAwait ( false ) ;
262257 }
263- } , options . WithContext ( this ) ) ;
258+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
264259 }
265260
266261 public Task < Subscription > OnDownloadEndAsync ( Action < DownloadEndEventArgs > handler , ContextSubscriptionOptions ? options = null )
@@ -271,7 +266,7 @@ public Task<Subscription> OnDownloadEndAsync(Action<DownloadEndEventArgs> handle
271266 {
272267 handler ( e ) ;
273268 }
274- } , options . WithContext ( this ) ) ;
269+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
275270 }
276271
277272 public Task < Subscription > OnDownloadEndAsync ( Func < DownloadEndEventArgs , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -282,7 +277,7 @@ public Task<Subscription> OnDownloadEndAsync(Func<DownloadEndEventArgs, Task> ha
282277 {
283278 await handler ( e ) . ConfigureAwait ( false ) ;
284279 }
285- } , options . WithContext ( this ) ) ;
280+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
286281 }
287282
288283 public Task < Subscription > OnNavigationAbortedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -293,7 +288,7 @@ public Task<Subscription> OnNavigationAbortedAsync(Action<NavigationInfo> handle
293288 {
294289 handler ( e ) ;
295290 }
296- } , options . WithContext ( this ) ) ;
291+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
297292 }
298293
299294 public Task < Subscription > OnNavigationAbortedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -304,7 +299,7 @@ public Task<Subscription> OnNavigationAbortedAsync(Func<NavigationInfo, Task> ha
304299 {
305300 await handler ( e ) . ConfigureAwait ( false ) ;
306301 }
307- } , options . WithContext ( this ) ) ;
302+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
308303 }
309304
310305 public Task < Subscription > OnNavigationFailedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -315,7 +310,7 @@ public Task<Subscription> OnNavigationFailedAsync(Action<NavigationInfo> handler
315310 {
316311 handler ( e ) ;
317312 }
318- } , options . WithContext ( this ) ) ;
313+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
319314 }
320315
321316 public Task < Subscription > OnNavigationFailedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -326,7 +321,7 @@ public Task<Subscription> OnNavigationFailedAsync(Func<NavigationInfo, Task> han
326321 {
327322 await handler ( e ) . ConfigureAwait ( false ) ;
328323 }
329- } , options . WithContext ( this ) ) ;
324+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
330325 }
331326
332327 public Task < Subscription > OnNavigationCommittedAsync ( Action < NavigationInfo > handler , ContextSubscriptionOptions ? options = null )
@@ -337,7 +332,7 @@ public Task<Subscription> OnNavigationCommittedAsync(Action<NavigationInfo> hand
337332 {
338333 handler ( e ) ;
339334 }
340- } , options . WithContext ( this ) ) ;
335+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
341336 }
342337
343338 public Task < Subscription > OnNavigationCommittedAsync ( Func < NavigationInfo , Task > handler , ContextSubscriptionOptions ? options = null )
@@ -348,7 +343,7 @@ public Task<Subscription> OnNavigationCommittedAsync(Func<NavigationInfo, Task>
348343 {
349344 await handler ( e ) . ConfigureAwait ( false ) ;
350345 }
351- } , options . WithContext ( this ) ) ;
346+ } , ContextSubscriptionOptions . WithContext ( options , this ) ) ;
352347 }
353348
354349 public bool Equals ( BrowsingContext ? other )
0 commit comments