public CognitiveController(Bitmaps input, CognitiveData output) { this.input = input; this.output = output; try { var cogKey = ConfigurationManager.AppSettings["CognitiveKey"]; Logger.LogInfo($"Cognitive Key: {cogKey}"); } catch (Exception ex) { Logger.LogException(ex); } input.PropertyChanged += Input_PropertyChanged; }
public MainWindow() { InitializeComponent(); Logger.LogReceived += log; var configObj = Application.Current.Resources["Config"]; updateConfig(configObj as Config); var bmpsObj = Application.Current.Resources["Bitmaps"]; bitmaps = bmpsObj as Bitmaps; var analyzerOutObj = Application.Current.Resources["AnalyzerOuput"]; analyzerOutput = analyzerOutObj as AnalyzerOutput; var useGPUObj = ConfigurationManager.AppSettings["UseGPU"]; bool useGPU = false; if (useGPUObj != null) { bool.TryParse(useGPUObj.ToString(), out useGPU); } analyzer = new Analyzer(bitmaps, analyzerOutput, useGPU); var cogObj = Application.Current.Resources["CognitiveData"]; cognitiveData = cogObj as CognitiveData; cognitiveController = new CognitiveController(bitmaps, cognitiveData); Closed += MainWindow_Closed; frameTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(20), DispatcherPriority.Normal, timerElapsed, this.Dispatcher); }