public ControlView()
        {
            InitializeComponent();

            _recordInfoCollection = (CollectionViewSource)Resources["RecordInfoListKey"];
            Observable.FromEventPattern <TextChangedEventArgs>(RecordSearchBox, "TextChanged")
            .Throttle(TimeSpan.FromMilliseconds(SEARCH_REFRESH_DELAY_MS))
            .ObserveOnDispatcher()
            .Subscribe(t => _recordInfoCollection.View.Refresh());

            // Design time!
            if (DesignerProperties.GetIsInDesignMode(this))
            {
                var appConfiguration        = new CapFrameXConfiguration();
                var recordDirectoryObserver = new RecordDirectoryObserver(appConfiguration,
                                                                          new LoggerFactory().CreateLogger <RecordDirectoryObserver>());

                DataContext = new ControlViewModel(new RecordDirectoryObserver(appConfiguration,
                                                                               new LoggerFactory().CreateLogger <RecordDirectoryObserver>()), new EventAggregator(),
                                                   new CapFrameXConfiguration(), new RecordDataProvider(recordDirectoryObserver, appConfiguration,
                                                                                                        new LoggerFactory().CreateLogger <RecordDataProvider>()));
            }

            SetSortSettings((DataContext as ControlViewModel).AppConfiguration);
        }
        private string GetOutputFilename(string processName)
        {
            var    filename          = CaptureServiceConfiguration.GetCaptureFilename(processName);
            string observedDirectory = RecordDirectoryObserver
                                       .GetInitialObservedDirectory(_appConfiguration.ObservedDirectory);

            return(Path.Combine(observedDirectory, filename));
        }
Exemple #3
0
        public StateView()
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                var appConfiguration        = new CapFrameXConfiguration();
                var statisticProvider       = new FrametimeStatisticProvider(appConfiguration);
                var recordDirectoryObserver = new RecordDirectoryObserver(appConfiguration,
                                                                          new LoggerFactory().CreateLogger <RecordDirectoryObserver>());
                var recordDataProvider = new RecordDataProvider(recordDirectoryObserver, appConfiguration,
                                                                new LoggerFactory().CreateLogger <RecordDataProvider>());
                var overlayEntryProvider = new OverlayEntryProvider();
                var appVersionProvider   = new AppVersionProvider();
                var webVersionProvider   = new WebVersionProvider();
                DataContext = new StateViewModel(new RecordDirectoryObserver(appConfiguration,
                                                                             new LoggerFactory().CreateLogger <RecordDirectoryObserver>()),
                                                 new EventAggregator(), appConfiguration, new PresentMonCaptureService(),
                                                 new OverlayService(statisticProvider, recordDataProvider, overlayEntryProvider, appConfiguration,
                                                                    new LoggerFactory().CreateLogger <OverlayService>()),
                                                 new UpdateCheck(appVersionProvider, webVersionProvider), appVersionProvider, webVersionProvider);
            }
        }