@@ -29,7 +29,7 @@ public async Task<BrowsingContext> CreateAsync(ContextType type, CreateOptions?
29
29
{
30
30
var @params = new CreateParameters ( type , options ? . ReferenceContext , options ? . Background , options ? . UserContext ) ;
31
31
32
- var createResult = await Broker . ExecuteCommandAsync < CreateCommand , CreateResult > ( new CreateCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
32
+ var createResult = await Broker . ExecuteCommandAsync ( new CreateCommand ( @params ) , options , JsonContext . CreateCommand , JsonContext . CreateResult ) . ConfigureAwait ( false ) ;
33
33
34
34
return createResult . Context ;
35
35
}
@@ -38,77 +38,77 @@ public async Task<NavigateResult> NavigateAsync(BrowsingContext context, string
38
38
{
39
39
var @params = new NavigateParameters ( context , url , options ? . Wait ) ;
40
40
41
- return await Broker . ExecuteCommandAsync < NavigateCommand , NavigateResult > ( new NavigateCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
41
+ return await Broker . ExecuteCommandAsync ( new NavigateCommand ( @params ) , options , JsonContext . NavigateCommand , JsonContext . NavigateResult ) . ConfigureAwait ( false ) ;
42
42
}
43
43
44
44
public async Task < EmptyResult > ActivateAsync ( BrowsingContext context , ActivateOptions ? options = null )
45
45
{
46
46
var @params = new ActivateParameters ( context ) ;
47
47
48
- return await Broker . ExecuteCommandAsync < ActivateCommand , EmptyResult > ( new ActivateCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
48
+ return await Broker . ExecuteCommandAsync ( new ActivateCommand ( @params ) , options , JsonContext . ActivateCommand , JsonContext . EmptyResult ) . ConfigureAwait ( false ) ;
49
49
}
50
50
51
51
public async Task < LocateNodesResult > LocateNodesAsync ( BrowsingContext context , Locator locator , LocateNodesOptions ? options = null )
52
52
{
53
53
var @params = new LocateNodesParameters ( context , locator , options ? . MaxNodeCount , options ? . SerializationOptions , options ? . StartNodes ) ;
54
54
55
- return await Broker . ExecuteCommandAsync < LocateNodesCommand , LocateNodesResult > ( new LocateNodesCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
55
+ return await Broker . ExecuteCommandAsync ( new LocateNodesCommand ( @params ) , options , JsonContext . LocateNodesCommand , JsonContext . LocateNodesResult ) . ConfigureAwait ( false ) ;
56
56
}
57
57
58
58
public async Task < CaptureScreenshotResult > CaptureScreenshotAsync ( BrowsingContext context , CaptureScreenshotOptions ? options = null )
59
59
{
60
60
var @params = new CaptureScreenshotParameters ( context , options ? . Origin , options ? . Format , options ? . Clip ) ;
61
61
62
- return await Broker . ExecuteCommandAsync < CaptureScreenshotCommand , CaptureScreenshotResult > ( new CaptureScreenshotCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
62
+ return await Broker . ExecuteCommandAsync ( new CaptureScreenshotCommand ( @params ) , options , JsonContext . CaptureScreenshotCommand , JsonContext . CaptureScreenshotResult ) . ConfigureAwait ( false ) ;
63
63
}
64
64
65
65
public async Task < EmptyResult > CloseAsync ( BrowsingContext context , CloseOptions ? options = null )
66
66
{
67
67
var @params = new CloseParameters ( context , options ? . PromptUnload ) ;
68
68
69
- return await Broker . ExecuteCommandAsync < CloseCommand , EmptyResult > ( new CloseCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
69
+ return await Broker . ExecuteCommandAsync ( new CloseCommand ( @params ) , options , JsonContext . BrowsingContext_CloseCommand , JsonContext . EmptyResult ) . ConfigureAwait ( false ) ;
70
70
}
71
71
72
72
public async Task < TraverseHistoryResult > TraverseHistoryAsync ( BrowsingContext context , int delta , TraverseHistoryOptions ? options = null )
73
73
{
74
74
var @params = new TraverseHistoryParameters ( context , delta ) ;
75
75
76
- return await Broker . ExecuteCommandAsync < TraverseHistoryCommand , TraverseHistoryResult > ( new TraverseHistoryCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
76
+ return await Broker . ExecuteCommandAsync ( new TraverseHistoryCommand ( @params ) , options , JsonContext . TraverseHistoryCommand , JsonContext . TraverseHistoryResult ) . ConfigureAwait ( false ) ;
77
77
}
78
78
79
79
public async Task < NavigateResult > ReloadAsync ( BrowsingContext context , ReloadOptions ? options = null )
80
80
{
81
81
var @params = new ReloadParameters ( context , options ? . IgnoreCache , options ? . Wait ) ;
82
82
83
- return await Broker . ExecuteCommandAsync < ReloadCommand , NavigateResult > ( new ReloadCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
83
+ return await Broker . ExecuteCommandAsync ( new ReloadCommand ( @params ) , options , JsonContext . ReloadCommand , JsonContext . NavigateResult ) . ConfigureAwait ( false ) ;
84
84
}
85
85
86
86
public async Task < EmptyResult > SetViewportAsync ( BrowsingContext context , SetViewportOptions ? options = null )
87
87
{
88
88
var @params = new SetViewportParameters ( context , options ? . Viewport , options ? . DevicePixelRatio ) ;
89
89
90
- return await Broker . ExecuteCommandAsync < SetViewportCommand , EmptyResult > ( new SetViewportCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
90
+ return await Broker . ExecuteCommandAsync ( new SetViewportCommand ( @params ) , options , JsonContext . SetViewportCommand , JsonContext . EmptyResult ) . ConfigureAwait ( false ) ;
91
91
}
92
92
93
93
public async Task < GetTreeResult > GetTreeAsync ( GetTreeOptions ? options = null )
94
94
{
95
95
var @params = new GetTreeParameters ( options ? . MaxDepth , options ? . Root ) ;
96
96
97
- return await Broker . ExecuteCommandAsync < GetTreeCommand , GetTreeResult > ( new GetTreeCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
97
+ return await Broker . ExecuteCommandAsync ( new GetTreeCommand ( @params ) , options , JsonContext . GetTreeCommand , JsonContext . GetTreeResult ) . ConfigureAwait ( false ) ;
98
98
}
99
99
100
100
public async Task < PrintResult > PrintAsync ( BrowsingContext context , PrintOptions ? options = null )
101
101
{
102
102
var @params = new PrintParameters ( context , options ? . Background , options ? . Margin , options ? . Orientation , options ? . Page , options ? . PageRanges , options ? . Scale , options ? . ShrinkToFit ) ;
103
103
104
- return await Broker . ExecuteCommandAsync < PrintCommand , PrintResult > ( new PrintCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
104
+ return await Broker . ExecuteCommandAsync ( new PrintCommand ( @params ) , options , JsonContext . PrintCommand , JsonContext . PrintResult ) . ConfigureAwait ( false ) ;
105
105
}
106
106
107
107
public async Task < EmptyResult > HandleUserPromptAsync ( BrowsingContext context , HandleUserPromptOptions ? options = null )
108
108
{
109
109
var @params = new HandleUserPromptParameters ( context , options ? . Accept , options ? . UserText ) ;
110
110
111
- return await Broker . ExecuteCommandAsync < HandleUserPromptCommand , EmptyResult > ( new HandleUserPromptCommand ( @params ) , options , JsonContext ) . ConfigureAwait ( false ) ;
111
+ return await Broker . ExecuteCommandAsync ( new HandleUserPromptCommand ( @params ) , options , JsonContext . HandleUserPromptCommand , JsonContext . EmptyResult ) . ConfigureAwait ( false ) ;
112
112
}
113
113
114
114
public async Task < Subscription > OnNavigationStartedAsync ( Func < NavigationInfo , Task > handler , BrowsingContextsSubscriptionOptions ? options = null )
0 commit comments