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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 696 - (show annotations) (download)
Mon Jun 17 11:47:23 2013 UTC (7 years, 8 months ago) by william
File size: 3617 byte(s)

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Windows.Forms;
6
7 namespace RomCheater.Core
8 {
9 public interface IWebBrowserProvider
10 {
11 IWebBrowserInterface GetProvider();
12 }
13 public interface IWebBrowserInterface
14 {
15 //WebBrowser Provider { get; }
16 void Navigate(string urlString);
17 void Navigate(Uri url);
18 //void Navigate(string urlString, bool newWindow);
19 //void Navigate(string urlString, string targetFrameName);
20 //void Navigate(Uri url, bool newWindow);
21 //void Navigate(Uri url, string targetFrameName);
22 //void Navigate(string urlString, string targetFrameName, byte[] postData, string additionalHeaders);
23 //void Navigate(Uri url, string targetFrameName, byte[] postData, string additionalHeaders);
24
25 }
26
27 //public class WebBrowserProvider : IWebBrowserProvider
28 //{
29 // public WebBrowserProvider(IWebBrowserInterface provider)
30 // {
31 // _provider = provider;
32 // }
33
34 // #region IWebBrowserProvider Members
35 // private IWebBrowserInterface _provider;
36 // public IWebBrowserInterface GetProvider()
37 // {
38 // return _provider;
39 // }
40 // #endregion
41 //}
42
43 public class EmptyWebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface
44 {
45 public EmptyWebBrowserProvider() :base()
46 {
47 }
48 }
49
50 public class WebBrowserProvider : BaseWebBrowserProvider, IWebBrowserInterface
51 {
52 public WebBrowserProvider() : this(new WebBrowser()) { }
53 public WebBrowserProvider(IWebBrowserInterface provider) { }
54 public WebBrowserProvider(WebBrowser provider)
55 : base(provider)
56 {
57 }
58 }
59
60 public class BaseWebBrowserProvider : IWebBrowserInterface, IWebBrowserProvider
61 {
62
63 public BaseWebBrowserProvider() : this(new WebBrowser()) { }
64 protected BaseWebBrowserProvider(WebBrowser provider)
65 {
66 this.Provider = provider;
67 }
68 #region IWebBrowserInterface Members
69 private WebBrowser _Provider;
70 public WebBrowser Provider { get { return _Provider; } protected set { _Provider = value; } }
71
72 #region Extensions to WebBrowser provider
73 public void Navigate(string urlString) { this.Provider.Navigate(urlString); }
74 public void Navigate(Uri url) { this.Provider.Navigate(url); }
75 //public void Navigate(string urlString, bool newWindow) { this.Provider.Navigate(urlString, newWindow); }
76 //public void Navigate(string urlString, string targetFrameName) { this.Provider.Navigate(urlString, targetFrameName); }
77 //public void Navigate(Uri url, bool newWindow) { this.Provider.Navigate(url, newWindow); }
78 //public void Navigate(Uri url, string targetFrameName) { this.Provider.Navigate(url, targetFrameName); }
79 //public void Navigate(string urlString, string targetFrameName, byte[] postData, string additionalHeaders) { this.Provider.Navigate(urlString, targetFrameName, postData, additionalHeaders); }
80 //public void Navigate(Uri url, string targetFrameName, byte[] postData, string additionalHeaders) { this.Provider.Navigate(url, targetFrameName, postData, additionalHeaders); }
81 #endregion
82 #endregion
83
84 #region IWebBrowserProvider Members
85 public IWebBrowserInterface GetProvider() { return (IWebBrowserInterface)this; }
86 #endregion
87 }
88
89 }

  ViewVC Help
Powered by ViewVC 1.1.22