/[RomCheater]/trunk/RomCheater.Core/IWebBrowserProvider.cs
ViewVC logotype

Diff of /trunk/RomCheater.Core/IWebBrowserProvider.cs

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

--- trunk/RomCheater.Core/IWebBrowserProvider.cs	2013/06/19 15:32:53	733
+++ trunk/RomCheater.Core/IWebBrowserProvider.cs	2013/06/19 21:20:22	740
@@ -17,41 +17,38 @@
         void Navigate(Uri url);
     }
 
-    public class EmptyWebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface
+    internal class EmptyWebBrowserProvider : IWebBrowserInterface, IWebBrowserProvider
     {
-        private WebBrowserProvider BackingProvider = new WebBrowserProvider();
-        public EmptyWebBrowserProvider()
-            : base()
-        {
-            this.BackingProvider = new WebBrowserProvider(this);           
-        }
-        public IWebBrowserInterface Provider
-        {
-            get { return this.BackingProvider; }
-        }
+        private WebBrowserProvider BackingProvider;
+        public EmptyWebBrowserProvider() : base() { this.BackingProvider = new WebBrowserProvider(this); }
+        //public IWebBrowserInterface Provider
+        //{
+        //    get { return this.BackingProvider; }
+        //}
 
         #region IWebBrowserInterface Members
-        public void Navigate(string urlString)
+
+        public void Navigate(string urlString) { logger.Debug.WriteLine("called::NavigateInternal(string urlString)::{0}", urlString); System.Diagnostics.Process.Start(urlString); }
+        public void Navigate(Uri url) { logger.Debug.WriteLine("called::NavigateInternal(Uri url)::{0}", url.ToString()); Navigate(url.ToString()); }
+        #endregion
+
+        public IWebBrowserInterface GetProvider()
         {
-            ////this.Provider.Navigate(urlString);
-            //this.webBrowser.Navigate(urlString);
-            System.Diagnostics.Process.Start(urlString);
+            return this.BackingProvider.GetProvider();
         }
-        public void Navigate(Uri url) { Navigate(url.ToString()); }
-        #endregion
     }
 
     public class WebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface
     {
-        public static IWebBrowserInterface DefaultProvider { get { return WebBrowserProvider.EmptyProvider; } }
-        public static IWebBrowserInterface EmptyProvider { get { return WebBrowserProvider.Empty; } }
-        public static IWebBrowserInterface Empty { get { return new EmptyWebBrowserProvider(); } }
-        public WebBrowserProvider() { }
-        //public WebBrowserProvider(IWebBrowserInterface provider) { }
-        public WebBrowserProvider(IWebBrowserInterface provider)
-            : base(provider)
-        {
-        }
+        public static IWebBrowserProvider DefaultProvider { get { return WebBrowserProvider.EmptyProvider; } }
+        public static IWebBrowserProvider EmptyProvider { get { return WebBrowserProvider.Empty; } }
+        public static IWebBrowserProvider Empty { get { return new EmptyWebBrowserProvider(); } }
+        protected WebBrowserProvider() : this(new EmptyWebBrowserProvider()) { }
+        public WebBrowserProvider(IWebBrowserInterface provider) : base(provider) { }
+        //#region IWebBrowserInterface Members
+        //public virtual void Navigate(string urlString) { base.Navigate(urlString); }
+        //public virtual void Navigate(Uri url) { base.Navigate(url); }
+        //#endregion
     }
 
     public abstract class BaseWebBrowserProvider : IWebBrowserInterface, IWebBrowserProvider
@@ -67,11 +64,12 @@
         public IWebBrowserInterface Provider { get { return _Provider; } protected set { _Provider = value; } }
 
         #region Extensions to WebBrowser provider
-        public void Navigate(string urlString) { NavigateInternal(urlString); }
-        public void Navigate(Uri url) { NavigateInternal(url.ToString()); }  
+        public void Navigate(string urlString) { logger.Debug.WriteLine("called::Navigate(string urlString)::{0}", urlString); NavigateInternal(urlString); }
+        public void Navigate(Uri url) { logger.Debug.WriteLine("called::Navigate(Uri url)::{0}", url.ToString()); NavigateInternal(url.ToString()); }  
 
         private void NavigateInternal(string url)
         {
+            logger.Debug.WriteLine("called::NavigateInternal(string url)::{0}", url);
             try
             {
                 try

 

  ViewVC Help
Powered by ViewVC 1.1.22