HRESULT IExplorerBrowserEvents.OnNavigationFailed(IntPtr pidlFolder)
        {
            var failedLocation = ShellFactory.FromShellItem(ShellItem.FromPIDL((PIDL)pidlFolder));
            var args           = new NavigationFailedEventArgs(failedLocation);

            OnNavigationFailed(args);

            return(COMErrorCodes.S_OK);
        }
        HRESULT IExplorerBrowserEvents.OnNavigationPending(IntPtr pidlFolder)
        {
            var pendingLocation = ShellFactory.FromShellItem(ShellItem.FromPIDL((PIDL)pidlFolder));
            var args            = new NavigationPendingEventArgs(pendingLocation);

            OnNavigationPending(args);

            return(args.Cancel ? COMErrorCodes.Cancelled : COMErrorCodes.S_OK);
        }
        HRESULT IExplorerBrowserEvents.OnNavigationComplete(IntPtr pidlFolder)
        {
            using (var folderView = FolderView.Create(this))
            {
                this.FolderSettings.ViewMode = folderView.ViewMode;
            }

            var newLocation = ShellFactory.FromShellItem(ShellItem.FromPIDL((PIDL)pidlFolder));
            var args        = new NavigationCompletedEventArgs(newLocation);

            OnNavigationCompleted(args);

            return(COMErrorCodes.S_OK);
        }