From ee7c8efdd94f05f62d1600c72e322c86951d84fc Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 21 May 2015 11:36:37 +1000 Subject: [PATCH] A few more resharper inspired cleanups --- CefSharp.Wpf/ChromiumWebBrowser.cs | 27 ++++++++++++--------------- CefSharp/Internals/IBrowserAdapter.cs | 3 --- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 95a545f68..e5017f708 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -502,21 +502,18 @@ namespace CefSharp.Wpf protected virtual void OnIsBrowserInitializedChanged(bool oldValue, bool newValue) { - managedCefBrowserAdapter.GetZoomLevelAsync() - .ContinueWith(new Action>((Task 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 diff --git a/CefSharp/Internals/IBrowserAdapter.cs b/CefSharp/Internals/IBrowserAdapter.cs index 2e9a9a01f..6d51ff674 100644 --- a/CefSharp/Internals/IBrowserAdapter.cs +++ b/CefSharp/Internals/IBrowserAdapter.cs @@ -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