/[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 811 by william, Wed Jun 19 21:20:22 2013 UTC revision 812 by william, Tue Apr 15 14:52:10 2014 UTC
# Line 4  using System.Linq; Line 4  using System.Linq;
4  using System.Text;  using System.Text;
5  using System.Windows.Forms;  using System.Windows.Forms;
6  using RomCheater.Logging;  using RomCheater.Logging;
7    using Enterprise.Logging;
8    
9  namespace RomCheater.Core  namespace RomCheater.Core
10  {  {
# Line 28  namespace RomCheater.Core Line 29  namespace RomCheater.Core
29    
30          #region IWebBrowserInterface Members          #region IWebBrowserInterface Members
31    
32          public void Navigate(string urlString) { logger.Debug.WriteLine("called::NavigateInternal(string urlString)::{0}", urlString); System.Diagnostics.Process.Start(urlString); }          public void Navigate(string urlString) { gLog.Debug.WriteLine("called::NavigateInternal(string urlString)::{0}", urlString); System.Diagnostics.Process.Start(urlString); }
33          public void Navigate(Uri url) { logger.Debug.WriteLine("called::NavigateInternal(Uri url)::{0}", url.ToString()); Navigate(url.ToString()); }          public void Navigate(Uri url) { gLog.Debug.WriteLine("called::NavigateInternal(Uri url)::{0}", url.ToString()); Navigate(url.ToString()); }
34          #endregion          #endregion
35    
36          public IWebBrowserInterface GetProvider()          public IWebBrowserInterface GetProvider()
# Line 64  namespace RomCheater.Core Line 65  namespace RomCheater.Core
65          public IWebBrowserInterface Provider { get { return _Provider; } protected set { _Provider = value; } }          public IWebBrowserInterface Provider { get { return _Provider; } protected set { _Provider = value; } }
66    
67          #region Extensions to WebBrowser provider          #region Extensions to WebBrowser provider
68          public void Navigate(string urlString) { logger.Debug.WriteLine("called::Navigate(string urlString)::{0}", urlString); NavigateInternal(urlString); }          public void Navigate(string urlString) { gLog.Debug.WriteLine("called::Navigate(string urlString)::{0}", urlString); NavigateInternal(urlString); }
69          public void Navigate(Uri url) { logger.Debug.WriteLine("called::Navigate(Uri url)::{0}", url.ToString()); NavigateInternal(url.ToString()); }            public void Navigate(Uri url) { gLog.Debug.WriteLine("called::Navigate(Uri url)::{0}", url.ToString()); NavigateInternal(url.ToString()); }  
70    
71          private void NavigateInternal(string url)          private void NavigateInternal(string url)
72          {          {
73              logger.Debug.WriteLine("called::NavigateInternal(string url)::{0}", url);              gLog.Debug.WriteLine("called::NavigateInternal(string url)::{0}", url);
74              try              try
75              {              {
76                  try                  try
# Line 94  namespace RomCheater.Core Line 95  namespace RomCheater.Core
95              catch (UriFormatException ex)              catch (UriFormatException ex)
96              {              {
97                  MessageBox.Show(string.Format("Could not navigate to url: '{0}'", url), string.Format("A Uri Format Exception Occurred in '{0}'", this.GetType().Name), MessageBoxButtons.OK, MessageBoxIcon.Error);                  MessageBox.Show(string.Format("Could not navigate to url: '{0}'", url), string.Format("A Uri Format Exception Occurred in '{0}'", this.GetType().Name), MessageBoxButtons.OK, MessageBoxIcon.Error);
98                  logger.Error.WriteLine("Unable to navigate to url: '{0}'", url);                  gLog.Error.WriteLine("Unable to navigate to url: '{0}'", url);
99                  logger.VerboseError.WriteLine(ex.ToString());                  gLog.Verbose.Error.WriteLine(ex.ToString());
100              }              }
101              catch (Exception ex)              catch (Exception ex)
102              {              {
103                  MessageBox.Show(string.Format("Could not navigate to url: '{0}'", url), string.Format("An {0} Exception Occurred in '{1}'",ex.GetType().Name, this.GetType().Name), MessageBoxButtons.OK, MessageBoxIcon.Error);                  MessageBox.Show(string.Format("Could not navigate to url: '{0}'", url), string.Format("An {0} Exception Occurred in '{1}'",ex.GetType().Name, this.GetType().Name), MessageBoxButtons.OK, MessageBoxIcon.Error);
104                  logger.Error.WriteLine("Unable to navigate to url: '{0}'", url);                  gLog.Error.WriteLine("Unable to navigate to url: '{0}'", url);
105                  logger.VerboseError.WriteLine(ex.ToString());                  gLog.Verbose.Error.WriteLine(ex.ToString());
106              }              }
107          }          }
108    

Legend:
Removed from v.811  
changed lines
  Added in v.812

  ViewVC Help
Powered by ViewVC 1.1.22