mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
A few more resharper inspired cleanups
This commit is contained in:
@@ -502,21 +502,18 @@ namespace CefSharp.Wpf
|
||||
|
||||
protected virtual void OnIsBrowserInitializedChanged(bool oldValue, bool newValue)
|
||||
{
|
||||
managedCefBrowserAdapter.GetZoomLevelAsync()
|
||||
.ContinueWith(new Action<Task<double>>((Task<double> previous) =>
|
||||
{
|
||||
if (previous.IsCompleted)
|
||||
{
|
||||
UiThreadRunAsync(() =>
|
||||
{
|
||||
SetCurrentValue(ZoomLevelProperty, previous.Result);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Unexpected failure of calling CEF->GetZoomLevelAsync", previous.Exception);
|
||||
}
|
||||
}), TaskContinuationOptions.ExecuteSynchronously);
|
||||
var task = managedCefBrowserAdapter.GetZoomLevelAsync();
|
||||
task.ContinueWith(previous =>
|
||||
{
|
||||
if (previous.IsCompleted)
|
||||
{
|
||||
UiThreadRunAsync(() => SetCurrentValue(ZoomLevelProperty, previous.Result));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Unexpected failure of calling CEF->GetZoomLevelAsync", previous.Exception);
|
||||
}
|
||||
}, TaskContinuationOptions.ExecuteSynchronously);
|
||||
}
|
||||
|
||||
#endregion IsInitialized dependency property
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
|
||||
Reference in New Issue
Block a user