/[RomCheater]/trunk/RomCheater/Docking/FloatingWebBrowser.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingWebBrowser.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Docking/FloatingWebBrowser.cs	2013/06/17 10:53:53	695
+++ trunk/RomCheater/Docking/FloatingWebBrowser.cs	2013/06/17 12:03:50	697
@@ -7,14 +7,80 @@
 using System.Text;
 using System.Windows.Forms;
 using WeifenLuo.WinFormsUI.Docking;
+using RomCheater.Core;
+using RomCheater.Logging;
 
 namespace RomCheater.Docking
 {
-    public partial class FloatingWebBrowser : DockContent
+    public partial class FloatingWebBrowser : DockContent, IWebBrowserInterface
     {
+        private WebBrowserProvider BackingProvider = new WebBrowserProvider();
         public FloatingWebBrowser()
         {
             InitializeComponent();
+            this.BackingProvider = new WebBrowserProvider(this.webBrowser);
+            init();
         }
+
+     
+
+        private void btnGo_Click(object sender, EventArgs e)
+        {
+            string url = txtWebAddress.Text;
+            this.Navigate(url);
+        }
+
+
+
+
+        public IWebBrowserInterface Provider
+        {
+            get { return this.BackingProvider; }
+        }
+
+        private void init()
+        {
+            init_events();
+
+            lblWebAddress.Font = this.Font;
+            txtWebAddress.Font = this.Font;
+            btnGo.Font = this.Font;
+
+        }
+
+        private void init_events()
+        {
+            this.webBrowser.Navigating += new WebBrowserNavigatingEventHandler(Provider_Navigating);
+            this.webBrowser.Navigated += new WebBrowserNavigatedEventHandler(Provider_Navigated);
+            this.webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Provider_DocumentCompleted);
+        }
+
+
+        #region Provider Events
+        void Provider_Navigated(object sender, WebBrowserNavigatedEventArgs e)
+        {
+
+        }
+
+        void Provider_Navigating(object sender, WebBrowserNavigatingEventArgs e)
+        {
+
+        }
+        void Provider_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
+        {
+            
+        }
+        #endregion
+
+        #region IWebBrowserInterface Members
+        public void Navigate(string urlString)
+        {
+            this.Provider.Navigate(urlString);
+        }
+        public void Navigate(Uri url)
+        {
+            this.Provider.Navigate(url);
+        }
+        #endregion
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22