﻿// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using CefSharp.Internals;

namespace CefSharp
{
    internal static class InternalWebBrowserExtensions
    {
        internal static void SetHandlersToNull(this IWebBrowserInternal browser)
        {
            browser.ResourceHandlerFactory = null;
            browser.JsDialogHandler = null;
            browser.DialogHandler = null;
            browser.DownloadHandler = null;
            browser.KeyboardHandler = null;
            browser.LifeSpanHandler = null;
            browser.MenuHandler = null;
            browser.FocusHandler = null;
            browser.RequestHandler = null;
            browser.DragHandler = null;
            browser.GeolocationHandler = null;
        }
    }
}

﻿// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using CefSharp.Internals;

namespace CefSharp
{
    internal static class InternalWebBrowserExtensions
    {
        internal static void SetHandlersToNull(this IWebBrowserInternal browser)
        {
            browser.DialogHandler = null;
            browser.RequestHandler = null;
            browser.DisplayHandler = null;
            browser.LoadHandler = null;
            browser.LifeSpanHandler = null;
            browser.KeyboardHandler = null;
            browser.JsDialogHandler = null;
            browser.DragHandler = null;
            browser.DownloadHandler = null;
            browser.MenuHandler = null;
            browser.FocusHandler = null;
            browser.ResourceHandlerFactory = null;
            browser.GeolocationHandler = null;
            browser.RenderProcessMessageHandler = null;
        }
    }
}

Set RenderProcessMessageHandler and LoadHandler to null on Dispose Reoder so they match the order in IWebBrowser so they're easier to compare
Set RenderProcessMessageHandler and LoadHandler to null on Dispose
Reoder so they match the order in IWebBrowser so they're easier to compare
