File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -35,20 +35,20 @@ public Rectangle Bounds
3535 {
3636 get
3737 {
38- return Task . Run < Rectangle > ( ( ) =>
39- {
40- var taskCompletionSource = new TaskCompletionSource < Rectangle > ( ) ;
38+ var taskCompletionSource = new TaskCompletionSource < Rectangle > ( ) ;
4139
42- BridgeConnector . Socket . On ( "browserView-getBounds-reply" , ( result ) =>
40+ Task . Run ( ( ) =>
41+ {
42+ BridgeConnector . Socket . On < Rectangle > ( "browserView-getBounds-reply" , ( result ) =>
4343 {
4444 BridgeConnector . Socket . Off ( "browserView-getBounds-reply" ) ;
45- taskCompletionSource . SetResult ( ( Rectangle ) result ) ;
45+ taskCompletionSource . SetResult ( result ) ;
4646 } ) ;
4747
4848 BridgeConnector . Socket . Emit ( "browserView-getBounds" , Id ) ;
49+ } ) ;
4950
50- return taskCompletionSource . Task ;
51- } ) . Result ;
51+ return taskCompletionSource . Task . GetAwaiter ( ) . GetResult ( ) ;
5252 }
5353 set
5454 {
@@ -59,7 +59,7 @@ public Rectangle Bounds
5959 /// <summary>
6060 /// BrowserView
6161 /// </summary>
62- internal BrowserView ( int id )
62+ internal BrowserView ( int id )
6363 {
6464 Id = id ;
6565
You can’t perform that action at this time.
0 commit comments