예제 #1
0
파일: Browser.cs 프로젝트: dnmsk/rProject
 public Browser(BrowserSettings browserSettings)
 {
     _browserSettings = browserSettings;
     var preferences = new WebPreferences();
     if (browserSettings.Proxy?.Length > 0) {
         preferences.ProxyConfig = browserSettings.Proxy;
     }
     WebCore.DoWork(() => {
         _session = WebCore.CreateWebSession(preferences);
         return default(int);
     });
 }
예제 #2
0
 public BrowserWrapper(WebRequestHelper webRequestHelper, string proxy)
     : base(webRequestHelper)
 {
     _browserSender = BrowserCreator.BuildBrowser(_browserSettings = new BrowserSettings {
         WindowHeight = 1080,
         WindowWidth = 1920,
         Proxy = proxy
     });
     _currentTabs = new SimpleKangooCache<string, BrowserTab>(s => {
         var tab = _browserSender.GetNewTab();
         tab.OpenPage(s);
         return tab;
     });
 }
예제 #3
0
 internal BrowserTab(BrowserSettings browserSettings, WebSession session)
 {
     WebCore.DoWork(() => {
         _webView = WebCore.CreateWebView(browserSettings.WindowWidth, browserSettings.WindowHeight, session, WebViewType.Offscreen);
         return default(int);
     });
     _reloadThread = new Thread(() => {
         while (true) {
             Thread.Sleep(TimeSpan.FromHours(1));
             WebCore.QueueWork(() => {
                 _webView.Reload(true);
             });
         }
     });
     _reloadThread.Start();
 }
예제 #4
0
 public static Browser BuildBrowser(BrowserSettings browserSettings)
 {
     return new Browser(browserSettings);
 }