public MainWindow() { this.config = Config.Load(); this.loggingService = new LoggingService(this.config); this.featureLogger = this.loggingService.ScopeForFeature("MainWindow"); this.featureLogger.Info("Log Config {0}", this.config.ToString()); InitializeComponent(); this.logView = new LogView(this.loggingService, this.config); this.capturePublisher = new ScreenCapturePublisher( new DiskPublisherService(this.config), new SFTPPublisherService(new SFTPClientFactory(this.config, this.secrets), this.config, this.featureLogger), this.featureLogger ) { EnableFtpPublishing = this.config.EnablePublishToSFTP, EnableDiskPublishing = this.config.EnablePublishToDisk }; // we do not start the timer until the user decides to do so this.timedCaptureService = new TimedCaptureService(this.featureLogger); this.recycleService = new PanelRecylceService(this, this.timedCaptureService, this.featureLogger); this.CreateCapturePanels(); this.KeyDown += this.MainWindow_KeyDown; }
public ScreenCapturePanel( Config appConfig, ScreenCapturePanelConfig config, ILoggingService logger, TimedCaptureService captureService, ScreenCapturePublisher capturePublisher, Func <ScreenCapturePanel, bool> requestFocus, Action <ScreenCapturePanel> releaseFocus) { InitializeComponent(); this.appConfig = appConfig; this.capturePublisher = capturePublisher; this.requestFocus = requestFocus; this.releaseFocus = releaseFocus; this.captureService = captureService; this.logger = logger.ScopeForFeature(this); this.Config = config; this.Location.Text = config.Url; this.SafeViewport = new SafeWebView(this.Viewport); this.SafeViewport.NavigationStarting += Viewport_NavigationStarting; this.SafeViewport.NavigationCompleted += Viewport_NavigationCompleted; this.SafeViewport.NewWindowRequested += Viewport_NewWindowRequested; }