public MainApplication(ProcessDetection processDetection, List <ClientMap> clientMapList, Settings appSettings) { this.AppSettings = appSettings; InitializeBackgroundWorker(); this.processDetection = processDetection; this.ClientMapping = clientMapList.AsEnumerable(); IEnumerable <MonitorInfo> monitors = MonitorEnumerationHelper.GetMonitors(); IEnumerable <MonitorInfo> primMons = from primaryMonitor in monitors where primaryMonitor.IsPrimary == true select primaryMonitor; MonitorInfo monitor = primMons.FirstOrDefault(); GraphicsCaptureItem item = CaptureHelper.CreateItemForMonitor(monitor.Hmon); switch (Settings.AppRunMode) { case SettingsAppRunMode.MockGame: this.mockImage = new Mat(Settings.MockImageGame); break; case SettingsAppRunMode.MockLauncher: this.mockImage = new Mat(Settings.MockImageLauncher); break; } if (item != null) { this.StartCaptureFromItem(item); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { // Process Watcher List <ProcessItem> processItems = new List <ProcessItem>(new ProcessItem[] { new ProcessItem("gameClient", "League of Legends"), new ProcessItem("launcher", "LeagueClientUx") }); var processDetection = new ProcessDetection(processItems); ClientTypeGame gameClient = new ClientTypeGame(previewImages, AppSettings); List <ClientMap> clientMapList = new List <ClientMap>(new ClientMap[] { new ClientMap("gameClient", gameClient), new ClientMap("launcher", new ClientTypeLauncher()), }); mainApplication = new MainApplication(processDetection, clientMapList, AppSettings); mainApplication.Dispatcher = Dispatcher; mainApplication.RootElement = RootElement; // Cue Connection var cb = new ICueBridge(); mainApplication.setiCueBridge(ref cb); }