/[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

revision 699 by william, Mon Jun 17 12:40:47 2013 UTC revision 740 by william, Wed Jun 19 21:20:22 2013 UTC
# Line 17  namespace RomCheater.Core Line 17  namespace RomCheater.Core
17          void Navigate(Uri url);          void Navigate(Uri url);
18      }      }
19    
20      public class EmptyWebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface      internal class EmptyWebBrowserProvider : IWebBrowserInterface, IWebBrowserProvider
21      {      {
22          public EmptyWebBrowserProvider() :base()          private WebBrowserProvider BackingProvider;
23            public EmptyWebBrowserProvider() : base() { this.BackingProvider = new WebBrowserProvider(this); }
24            //public IWebBrowserInterface Provider
25            //{
26            //    get { return this.BackingProvider; }
27            //}
28    
29            #region IWebBrowserInterface Members
30    
31            public void Navigate(string urlString) { logger.Debug.WriteLine("called::NavigateInternal(string urlString)::{0}", urlString); System.Diagnostics.Process.Start(urlString); }
32            public void Navigate(Uri url) { logger.Debug.WriteLine("called::NavigateInternal(Uri url)::{0}", url.ToString()); Navigate(url.ToString()); }
33            #endregion
34    
35            public IWebBrowserInterface GetProvider()
36          {          {
37                return this.BackingProvider.GetProvider();
38          }          }
39      }      }
40    
41      public class WebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface      public class WebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface
42      {      {
43          public WebBrowserProvider() { }          public static IWebBrowserProvider DefaultProvider { get { return WebBrowserProvider.EmptyProvider; } }
44          //public WebBrowserProvider(IWebBrowserInterface provider) { }          public static IWebBrowserProvider EmptyProvider { get { return WebBrowserProvider.Empty; } }
45          public WebBrowserProvider(IWebBrowserInterface provider)          public static IWebBrowserProvider Empty { get { return new EmptyWebBrowserProvider(); } }
46              : base(provider)          protected WebBrowserProvider() : this(new EmptyWebBrowserProvider()) { }
47          {          public WebBrowserProvider(IWebBrowserInterface provider) : base(provider) { }
48          }          //#region IWebBrowserInterface Members
49            //public virtual void Navigate(string urlString) { base.Navigate(urlString); }
50            //public virtual void Navigate(Uri url) { base.Navigate(url); }
51            //#endregion
52      }      }
53    
54      public abstract class BaseWebBrowserProvider : IWebBrowserInterface, IWebBrowserProvider      public abstract class BaseWebBrowserProvider : IWebBrowserInterface, IWebBrowserProvider
# Line 47  namespace RomCheater.Core Line 64  namespace RomCheater.Core
64          public IWebBrowserInterface Provider { get { return _Provider; } protected set { _Provider = value; } }          public IWebBrowserInterface Provider { get { return _Provider; } protected set { _Provider = value; } }
65    
66          #region Extensions to WebBrowser provider          #region Extensions to WebBrowser provider
67          public void Navigate(string urlString) { NavigateInternal(urlString); }          public void Navigate(string urlString) { logger.Debug.WriteLine("called::Navigate(string urlString)::{0}", urlString); NavigateInternal(urlString); }
68          public void Navigate(Uri url) { NavigateInternal(url.ToString()); }            public void Navigate(Uri url) { logger.Debug.WriteLine("called::Navigate(Uri url)::{0}", url.ToString()); NavigateInternal(url.ToString()); }  
69    
70          private void NavigateInternal(string url)          private void NavigateInternal(string url)
71          {          {
72                logger.Debug.WriteLine("called::NavigateInternal(string url)::{0}", url);
73              try              try
74              {              {
75                  try                  try

Legend:
Removed from v.699  
changed lines
  Added in v.740

  ViewVC Help
Powered by ViewVC 1.1.22