diff --git a/SafeExamBrowser.Browser/BrowserApplicationController.cs b/SafeExamBrowser.Browser/BrowserApplicationController.cs index f0ecea0c..209192d7 100644 --- a/SafeExamBrowser.Browser/BrowserApplicationController.cs +++ b/SafeExamBrowser.Browser/BrowserApplicationController.cs @@ -64,12 +64,14 @@ namespace SafeExamBrowser.Browser else { CreateNewInstance(); + CreateNewInstance(); + CreateNewInstance(); } } private void CreateNewInstance() { - var control = new BrowserControl(); + var control = new BrowserControl("www.duckduckgo.com"); var window = uiFactory.CreateBrowserWindow(control); var instance = new BrowserApplicationInstance("DuckDuckGo"); @@ -77,8 +79,6 @@ namespace SafeExamBrowser.Browser instance.RegisterWindow(window); button.RegisterInstance(instance); - control.Address = "www.duckduckgo.com"; - window.Display(); } } diff --git a/SafeExamBrowser.Browser/BrowserControl.cs b/SafeExamBrowser.Browser/BrowserControl.cs index c5237491..0f36a774 100644 --- a/SafeExamBrowser.Browser/BrowserControl.cs +++ b/SafeExamBrowser.Browser/BrowserControl.cs @@ -6,12 +6,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -using CefSharp.Wpf; +using System.Windows.Forms; +using CefSharp.WinForms; using SafeExamBrowser.Contracts.UserInterface; namespace SafeExamBrowser.Browser { class BrowserControl : ChromiumWebBrowser, IBrowserControl { + public BrowserControl(string url) : base(url) + { + Dock = DockStyle.Fill; + } } } diff --git a/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj b/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj index b3fbedcc..943aa3a8 100644 --- a/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj +++ b/SafeExamBrowser.Browser/SafeExamBrowser.Browser.csproj @@ -1,6 +1,6 @@  - + @@ -52,10 +52,9 @@ MinimumRecommendedRules.ruleset - - + @@ -63,13 +62,14 @@ - - + + Component + @@ -86,7 +86,9 @@ - + + Designer + @@ -98,13 +100,13 @@ - - + + - xcopy /E /Y "$(ProjectDir)bin\$(PlatformName)\$(ConfigurationName)" "$(SolutionDir)SafeExamBrowser\bin\$(PlatformName)\$(ConfigurationName)" + \ No newline at end of file diff --git a/SafeExamBrowser.Browser/packages.config b/SafeExamBrowser.Browser/packages.config index b9a5f22b..92d8bc85 100644 --- a/SafeExamBrowser.Browser/packages.config +++ b/SafeExamBrowser.Browser/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/SafeExamBrowser.UserInterface/BrowserWindow.xaml b/SafeExamBrowser.UserInterface/BrowserWindow.xaml index c1743649..c16bd483 100644 --- a/SafeExamBrowser.UserInterface/BrowserWindow.xaml +++ b/SafeExamBrowser.UserInterface/BrowserWindow.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:SafeExamBrowser.UserInterface" mc:Ignorable="d" Title="BrowserWindow" Height="300" Width="300"> - - - + + + diff --git a/SafeExamBrowser.UserInterface/BrowserWindow.xaml.cs b/SafeExamBrowser.UserInterface/BrowserWindow.xaml.cs index 5c3df2c3..7719f4bf 100644 --- a/SafeExamBrowser.UserInterface/BrowserWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface/BrowserWindow.xaml.cs @@ -17,9 +17,9 @@ namespace SafeExamBrowser.UserInterface { InitializeComponent(); - if (browserControl is UIElement) + if (browserControl is System.Windows.Forms.Control) { - BrowserContainer.Content = browserControl; + BrowserControlHost.Child = browserControl as System.Windows.Forms.Control; } } diff --git a/SafeExamBrowser.UserInterface/SafeExamBrowser.UserInterface.csproj b/SafeExamBrowser.UserInterface/SafeExamBrowser.UserInterface.csproj index 6db33368..6a56eebc 100644 --- a/SafeExamBrowser.UserInterface/SafeExamBrowser.UserInterface.csproj +++ b/SafeExamBrowser.UserInterface/SafeExamBrowser.UserInterface.csproj @@ -51,6 +51,7 @@ + @@ -63,6 +64,7 @@ +