diff --git a/SafeExamBrowser.Browser.UnitTests/Handlers/DialogHandlerTests.cs b/SafeExamBrowser.Browser.UnitTests/Handlers/DialogHandlerTests.cs index 08cd9248..8c2146ed 100644 --- a/SafeExamBrowser.Browser.UnitTests/Handlers/DialogHandlerTests.cs +++ b/SafeExamBrowser.Browser.UnitTests/Handlers/DialogHandlerTests.cs @@ -71,7 +71,7 @@ namespace SafeExamBrowser.Browser.UnitTests.Handlers var threadId = default(int); callback.Setup(c => c.Cancel()).Callback(() => sync.Set()); - callback.Setup(c => c.Continue(It.IsAny(), It.IsAny>())).Callback(() => sync.Set()); + callback.Setup(c => c.Continue(It.IsAny>())).Callback(() => sync.Set()); sut.DialogRequested += (a) => { args = a; @@ -80,18 +80,18 @@ namespace SafeExamBrowser.Browser.UnitTests.Handlers threadId = Thread.CurrentThread.ManagedThreadId; }; - var status = sut.OnFileDialog(default, default, mode, default, title, initialPath, default, default, callback.Object); + var status = sut.OnFileDialog(default, default, mode, title, initialPath, default, callback.Object); sync.WaitOne(); if (confirm) { - callback.Verify(c => c.Continue(It.IsAny(), It.IsAny>()), Times.Once); + callback.Verify(c => c.Continue(It.IsAny>()), Times.Once); callback.Verify(c => c.Cancel(), Times.Never); } else { - callback.Verify(c => c.Continue(It.IsAny(), It.IsAny>()), Times.Never); + callback.Verify(c => c.Continue(It.IsAny>()), Times.Never); callback.Verify(c => c.Cancel(), Times.Once); } diff --git a/SafeExamBrowser.Browser.UnitTests/SafeExamBrowser.Browser.UnitTests.csproj b/SafeExamBrowser.Browser.UnitTests/SafeExamBrowser.Browser.UnitTests.csproj index 2381301b..beb33709 100644 --- a/SafeExamBrowser.Browser.UnitTests/SafeExamBrowser.Browser.UnitTests.csproj +++ b/SafeExamBrowser.Browser.UnitTests/SafeExamBrowser.Browser.UnitTests.csproj @@ -1,8 +1,8 @@  - - - + + + @@ -64,11 +64,11 @@ ..\packages\Castle.Core.5.0.0\lib\net462\Castle.Core.dll - - ..\packages\CefSharp.Common.101.0.180\lib\net452\CefSharp.dll + + ..\packages\CefSharp.Common.102.0.90\lib\net452\CefSharp.dll - - ..\packages\CefSharp.Common.101.0.180\lib\net452\CefSharp.Core.dll + + ..\packages\CefSharp.Common.102.0.90\lib\net452\CefSharp.Core.dll ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll @@ -151,11 +151,11 @@ - - - - + + + + - + \ No newline at end of file diff --git a/SafeExamBrowser.Browser.UnitTests/app.config b/SafeExamBrowser.Browser.UnitTests/app.config index b6aaa965..367eb98d 100644 --- a/SafeExamBrowser.Browser.UnitTests/app.config +++ b/SafeExamBrowser.Browser.UnitTests/app.config @@ -16,11 +16,11 @@ - + - + diff --git a/SafeExamBrowser.Browser.UnitTests/packages.config b/SafeExamBrowser.Browser.UnitTests/packages.config index 53803613..4321a5de 100644 --- a/SafeExamBrowser.Browser.UnitTests/packages.config +++ b/SafeExamBrowser.Browser.UnitTests/packages.config @@ -1,9 +1,9 @@  - - - + + + diff --git a/SafeExamBrowser.Browser/BrowserControl.cs b/SafeExamBrowser.Browser/BrowserControl.cs index 30ad6721..995acae7 100644 --- a/SafeExamBrowser.Browser/BrowserControl.cs +++ b/SafeExamBrowser.Browser/BrowserControl.cs @@ -98,7 +98,7 @@ namespace SafeExamBrowser.Browser control.CanDownload += (w, b, u, r, a) => a.Value = downloadHandler.CanDownload(w, b, u, r); control.DownloadUpdated += (w, b, d, c) => downloadHandler.OnDownloadUpdated(w, b, d, c); control.FaviconUrlChanged += (w, b, u) => displayHandler.OnFaviconUrlChange(w, b, u); - control.FileDialogRequested += (w, b, m, f, t, d, a, s, c) => dialogHandler.OnFileDialog(w, b, m, f, t, d, a, s, c); + control.FileDialogRequested += (w, b, m, t, d, f, c) => dialogHandler.OnFileDialog(w, b, m, t, d, f, c); control.FrameLoadStart += Control_FrameLoadStart; control.IsBrowserInitializedChanged += Control_IsBrowserInitializedChanged; control.KeyEvent += (w, b, t, k, n, m, s) => keyboardHandler.OnKeyEvent(w, b, t, k, n, m, s); diff --git a/SafeExamBrowser.Browser/BrowserWindow.cs b/SafeExamBrowser.Browser/BrowserWindow.cs index 0985eedf..0bfdc006 100644 --- a/SafeExamBrowser.Browser/BrowserWindow.cs +++ b/SafeExamBrowser.Browser/BrowserWindow.cs @@ -503,9 +503,7 @@ namespace SafeExamBrowser.Browser { Control.ExecuteJavascript("document.activeElement.tagName", result => { - var tagName = result.Result as string; - - if (tagName != null && tagName.ToUpper() == "BODY") + if (result.Result is string tagName && tagName?.ToUpper() == "BODY") { // This means the user is now at the start of the focus / tabIndex chain in the website. if (shiftPressed) diff --git a/SafeExamBrowser.Browser/Handlers/DialogHandler.cs b/SafeExamBrowser.Browser/Handlers/DialogHandler.cs index 2e742976..d204c9df 100644 --- a/SafeExamBrowser.Browser/Handlers/DialogHandler.cs +++ b/SafeExamBrowser.Browser/Handlers/DialogHandler.cs @@ -18,7 +18,7 @@ namespace SafeExamBrowser.Browser.Handlers { internal event DialogRequestedEventHandler DialogRequested; - public bool OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback) + public bool OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List acceptFilters, IFileDialogCallback callback) { var args = new DialogRequestedEventArgs { @@ -36,7 +36,7 @@ namespace SafeExamBrowser.Browser.Handlers { if (args.Success) { - callback.Continue(selectedAcceptFilter, new List { args.FullPath }); + callback.Continue(new List { args.FullPath }); } else { diff --git a/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj b/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj index cec41499..0e925d16 100644 --- a/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj +++ b/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj @@ -1,8 +1,8 @@  - - - + + + Debug @@ -53,14 +53,14 @@ prompt - - ..\packages\CefSharp.Common.101.0.180\lib\net452\CefSharp.dll + + ..\packages\CefSharp.Common.102.0.90\lib\net452\CefSharp.dll - - ..\packages\CefSharp.Common.101.0.180\lib\net452\CefSharp.Core.dll + + ..\packages\CefSharp.Common.102.0.90\lib\net452\CefSharp.Core.dll - - ..\packages\CefSharp.WinForms.101.0.180\lib\net462\CefSharp.WinForms.dll + + ..\packages\CefSharp.WinForms.102.0.90\lib\net462\CefSharp.WinForms.dll ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -195,10 +195,10 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + - + \ No newline at end of file diff --git a/SafeExamBrowser.Browser/Wrapper/CefSharpBrowserControl.cs b/SafeExamBrowser.Browser/Wrapper/CefSharpBrowserControl.cs index 6f733340..dbe4a14c 100644 --- a/SafeExamBrowser.Browser/Wrapper/CefSharpBrowserControl.cs +++ b/SafeExamBrowser.Browser/Wrapper/CefSharpBrowserControl.cs @@ -81,9 +81,9 @@ namespace SafeExamBrowser.Browser.Wrapper FaviconUrlChanged?.Invoke(webBrowser, browser, urls); } - public void OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback) + public void OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List acceptFilters, IFileDialogCallback callback) { - FileDialogRequested?.Invoke(webBrowser, browser, mode, flags, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback); + FileDialogRequested?.Invoke(webBrowser, browser, mode, title, defaultFilePath, acceptFilters, callback); } public void OnKeyEvent(IWebBrowser webBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey) diff --git a/SafeExamBrowser.Browser/Wrapper/CefSharpPopupControl.cs b/SafeExamBrowser.Browser/Wrapper/CefSharpPopupControl.cs index 31a29ba9..2b4a3fed 100644 --- a/SafeExamBrowser.Browser/Wrapper/CefSharpPopupControl.cs +++ b/SafeExamBrowser.Browser/Wrapper/CefSharpPopupControl.cs @@ -76,9 +76,9 @@ namespace SafeExamBrowser.Browser.Wrapper FaviconUrlChanged?.Invoke(webBrowser, browser, urls); } - public void OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback) + public void OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List acceptFilters, IFileDialogCallback callback) { - FileDialogRequested?.Invoke(webBrowser, browser, mode, flags, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback); + FileDialogRequested?.Invoke(webBrowser, browser, mode, title, defaultFilePath, acceptFilters, callback); } public void OnKeyEvent(IWebBrowser webBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey) diff --git a/SafeExamBrowser.Browser/Wrapper/Events/FileDialogRequestedEventHandler.cs b/SafeExamBrowser.Browser/Wrapper/Events/FileDialogRequestedEventHandler.cs index 89c9d851..a4ba2540 100644 --- a/SafeExamBrowser.Browser/Wrapper/Events/FileDialogRequestedEventHandler.cs +++ b/SafeExamBrowser.Browser/Wrapper/Events/FileDialogRequestedEventHandler.cs @@ -11,5 +11,5 @@ using CefSharp; namespace SafeExamBrowser.Browser.Wrapper.Events { - internal delegate void FileDialogRequestedEventHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback); + internal delegate void FileDialogRequestedEventHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List acceptFilters, IFileDialogCallback callback); } diff --git a/SafeExamBrowser.Browser/Wrapper/Handlers/DialogHandlerSwitch.cs b/SafeExamBrowser.Browser/Wrapper/Handlers/DialogHandlerSwitch.cs index 710b6512..8096f0fd 100644 --- a/SafeExamBrowser.Browser/Wrapper/Handlers/DialogHandlerSwitch.cs +++ b/SafeExamBrowser.Browser/Wrapper/Handlers/DialogHandlerSwitch.cs @@ -15,19 +15,19 @@ namespace SafeExamBrowser.Browser.Wrapper.Handlers { internal class DialogHandlerSwitch : IDialogHandler { - public bool OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback) + public bool OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List acceptFilters, IFileDialogCallback callback) { if (browser.IsPopup) { var control = ChromiumHostControl.FromBrowser(browser) as CefSharpPopupControl; - control?.OnFileDialog(webBrowser, browser, mode, flags, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback); + control?.OnFileDialog(webBrowser, browser, mode, title, defaultFilePath, acceptFilters, callback); } else { var control = ChromiumWebBrowser.FromBrowser(browser) as CefSharpBrowserControl; - control?.OnFileDialog(webBrowser, browser, mode, flags, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback); + control?.OnFileDialog(webBrowser, browser, mode, title, defaultFilePath, acceptFilters, callback); } return true; diff --git a/SafeExamBrowser.Browser/Wrapper/ICefSharpControl.cs b/SafeExamBrowser.Browser/Wrapper/ICefSharpControl.cs index c1859c55..80949804 100644 --- a/SafeExamBrowser.Browser/Wrapper/ICefSharpControl.cs +++ b/SafeExamBrowser.Browser/Wrapper/ICefSharpControl.cs @@ -40,7 +40,7 @@ namespace SafeExamBrowser.Browser.Wrapper void OnCanDownload(IWebBrowser webBrowser, IBrowser browser, string url, string requestMethod, GenericEventArgs args); void OnDownloadUpdated(IWebBrowser webBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback); void OnFaviconUrlChange(IWebBrowser webBrowser, IBrowser browser, IList urls); - void OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback); + void OnFileDialog(IWebBrowser webBrowser, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List acceptFilters, IFileDialogCallback callback); void OnKeyEvent(IWebBrowser webBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey); void OnLoadingProgressChange(IWebBrowser webBrowser, IBrowser browser, double progress); void OnOpenUrlFromTab(IWebBrowser webBrowser, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture, GenericEventArgs args); diff --git a/SafeExamBrowser.Browser/packages.config b/SafeExamBrowser.Browser/packages.config index b718fc73..8791b8df 100644 --- a/SafeExamBrowser.Browser/packages.config +++ b/SafeExamBrowser.Browser/packages.config @@ -1,9 +1,9 @@  - - - - + + + +