/// <summary>
        /// Starts the main application.
        /// </summary>
        /// <param name="applicationOptions">The application options.</param>
        private void StartMain(ApplicationOptions applicationOptions)
        {
            SetupApplication();
            var proxyServer = ProxyServerFactory.CreateSocksProxyServer();

            ShowHome(Navigator, proxyServer, applicationOptions.ProxyPort, applicationOptions.Minimized, applicationOptions.FirstStart);
        }
Exemple #2
0
 /// <summary>
 /// Downloads the page as text (extracts significant text from page) using the specified route.
 /// </summary>
 /// <param name="uri">The URI.</param>
 /// <param name="route">The route.</param>
 /// <returns></returns>
 public string DownloadText(Uri uri, Route route)
 {
     using (var proxyServer = ProxyServerFactory.CreateSocksProxyServer())
     {
         proxyServer.Port   = 0; // auto-select
         proxyServer.Routes = new[] { route };
         var textFilePath = Path.GetTempFileName();
         var path         = Assembly.GetEntryAssembly().Location;
         var arguments    = string.Format("--download={0} --save-text={1} --proxy=socks://localhost:{2}", uri, textFilePath, proxyServer.Port);
         var process      = Process.Start(path, arguments);
         process.WaitForExit();
         var text = File.ReadAllText(textFilePath);
         File.Delete(textFilePath);
         return(text);
     }
 }