public BrowserApplicationInstance(
     AppConfig appConfig,
     BrowserSettings settings,
     int id,
     bool isMainInstance,
     IFileSystemDialog fileSystemDialog,
     IHashAlgorithm hashAlgorithm,
     IMessageBox messageBox,
     IModuleLogger logger,
     IText text,
     IUserInterfaceFactory uiFactory,
     string startUrl)
 {
     this.appConfig        = appConfig;
     this.Id               = id;
     this.httpClient       = new HttpClient();
     this.isMainInstance   = isMainInstance;
     this.fileSystemDialog = fileSystemDialog;
     this.hashAlgorithm    = hashAlgorithm;
     this.messageBox       = messageBox;
     this.logger           = logger;
     this.settings         = settings;
     this.text             = text;
     this.uiFactory        = uiFactory;
     this.startUrl         = startUrl;
 }
예제 #2
0
 internal TestableResourceHandler(
     AppConfig appConfig,
     IRequestFilter filter,
     ILogger logger,
     BrowserSettings settings,
     WindowSettings windowSettings,
     IText text) : base(appConfig, filter, logger, settings, windowSettings, text)
 {
 }
예제 #3
0
        public void Initialize()
        {
            appConfig      = new AppConfig();
            logger         = new Mock <ILogger>();
            settings       = new BrowserSettings();
            windowSettings = new WindowSettings();

            sut = new DownloadHandler(appConfig, logger.Object, settings, windowSettings);
        }
예제 #4
0
 internal DownloadHandler(AppConfig appConfig, ILogger logger, BrowserSettings settings, WindowSettings windowSettings)
 {
     this.appConfig      = appConfig;
     this.callbacks      = new ConcurrentDictionary <int, DownloadFinishedCallback>();
     this.downloads      = new ConcurrentDictionary <int, Guid>();
     this.logger         = logger;
     this.settings       = settings;
     this.windowSettings = windowSettings;
 }
예제 #5
0
        public void Initialize()
        {
            appConfig      = new AppConfig();
            filter         = new Mock <IRequestFilter>();
            logger         = new Mock <ILogger>();
            settings       = new BrowserSettings();
            windowSettings = new WindowSettings();
            text           = new Mock <IText>();

            sut = new TestableResourceHandler(appConfig, filter.Object, logger.Object, settings, windowSettings, text.Object);
        }
예제 #6
0
        internal MainWindow(AppSettings appSettings, BrowserSettings settings, IMessageBox messageBox, int id, bool mainInstance, int numWindows, string startUrl, IModuleLogger logger, IText text)
        {
            this.appSettings  = appSettings;
            this.messageBox   = messageBox;
            this.logger       = logger;
            this.startUrl     = startUrl;
            this.text         = text;
            this.Id           = id;
            this.mainInstance = mainInstance;
            this.numWindows   = numWindows;
            this.settings     = settings;

            InitializeComponent();
        }
예제 #7
0
 internal RequestHandler(
     AppConfig appConfig,
     IRequestFilter filter,
     ILogger logger,
     ResourceHandler resourceHandler,
     BrowserSettings settings,
     WindowSettings windowSettings,
     IText text)
 {
     this.filter          = filter;
     this.logger          = logger;
     this.resourceHandler = resourceHandler;
     this.settings        = settings;
     this.windowSettings  = windowSettings;
 }
예제 #8
0
 internal ResourceHandler(
     AppConfig appConfig,
     IRequestFilter filter,
     ILogger logger,
     BrowserSettings settings,
     WindowSettings windowSettings,
     IText text)
 {
     this.appConfig      = appConfig;
     this.algorithm      = new SHA256Managed();
     this.filter         = filter;
     this.htmlLoader     = new HtmlLoader(text);
     this.logger         = logger;
     this.settings       = settings;
     this.windowSettings = windowSettings;
     this.text           = text;
 }
예제 #9
0
 public BrowserApplication(
     AppConfig appConfig,
     BrowserSettings settings,
     IFileSystemDialog fileSystemDialog,
     IHashAlgorithm hashAlgorithm,
     INativeMethods nativeMethods,
     IMessageBox messageBox,
     IModuleLogger logger,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.appConfig        = appConfig;
     this.fileSystemDialog = fileSystemDialog;
     this.hashAlgorithm    = hashAlgorithm;
     this.nativeMethods    = nativeMethods;
     this.instances        = new List <BrowserApplicationInstance>();
     this.logger           = logger;
     this.messageBox       = messageBox;
     this.settings         = settings;
     this.text             = text;
     this.uiFactory        = uiFactory;
 }
예제 #10
0
        public BrowserApplicationInstance(
            AppSettings appSettings,
            IMessageBox messageBox,
            int id,
            bool isMainInstance,
            int numWindows,
            string startUrl,
            IModuleLogger logger,
            IText text)
        {
            this.appSettings                         = appSettings;
            this.messageBox                          = messageBox;
            this.Id                                  = id;
            this.isMainInstance                      = isMainInstance;
            this.logger                              = logger;
            this.text                                = text;
            this.startUrl                            = startUrl;
            this.settings                            = new BrowserSettings();
            settings.QuitUrl                         = appSettings.QuitUrl;
            settings.DownloadDirectory               = appSettings.DownloadDirectory;
            settings.AllowDownloads                  = true;
            settings.MainWindow.AllowReloading       = appSettings.AllowReload;
            settings.AdditionalWindow.AllowReloading = appSettings.AllowReload;

            var instanceLogger = new ModuleLogger(logger, nameof(MainWindow));

            window = new MainWindow(appSettings, settings, messageBox, id, isMainInstance, numWindows, startUrl, instanceLogger, text);
            window.TerminationRequested += () => TerminationRequested?.Invoke();
            window.IconChanged          += (i) => IconChanged?.Invoke(i);

            Handle = window.Handle;
            Icon   = new BrowserIconResource();

            window.Closing        += Control_Closing;
            window.TitleChanged   += Control_TitleChanged;
            window.PopupRequested += Control_PopupRequested;
        }