packages/Windows API Code Pack 1.1/source/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.cs
/// <summary>
/// Cleans up the explorer browser events+object when the window is being taken down.
/// </summary>
/// <param name="e">An EventArgs that contains event data.</param>
Cleans up the explorer browser events+object when the window is being taken down.
Cleans up the explorer browser events + object when the window is being taken down .
protected override void OnHandleDestroyed(EventArgs e)
        {
            if (explorerBrowserControl != null)
            {
                viewEvents.DisconnectFromView();
                explorerBrowserControl.Unadvise(eventsCookie);
                ExplorerBrowserNativeMethods.IUnknown_SetSite(explorerBrowserControl, null);
                explorerBrowserControl.Destroy();
                Marshal.ReleaseComObject(explorerBrowserControl);
                explorerBrowserControl = null;
            }
            base.OnHandleDestroyed(e);
        }
protected override void OnHandleDestroyed ( EventArgs e ) { if ( explorerBrowserControl != null ) { viewEvents . DisconnectFromView ( ) ; explorerBrowserControl . Unadvise ( eventsCookie ) ; ExplorerBrowserNativeMethods . IUnknown_SetSite ( explorerBrowserControl , null ) ; explorerBrowserControl . Destroy ( ) ; Marshal . ReleaseComObject ( explorerBrowserControl ) ; explorerBrowserControl = null ; } base . OnHandleDestroyed ( e ) ; }
Cleans up the explorer browser events+object when the window is being taken down.
Cleans up the explorer browser events + object when the window is being taken down .
// unhook events // destroy the explorer browser control // release com reference to it
e
EventArgs
An EventArgs that contains event data.
An EventArgs that contains event data .