A few more resharper inspired cleanups

This commit is contained in:
amaitland
2015-05-21 11:36:37 +10:00
parent 996661de60
commit ee7c8efdd9
2 changed files with 12 additions and 18 deletions
+12 -15
View File
@@ -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
View File
@@ -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