public MainWindow() { InitializeComponent(); _rules_them_all = OperationsManager.OperationsManager.GetInstance(); this.DataContext = this._rules_them_all; string version_string = Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString(); string program_title = "ASML-McCallister Home Security "; this.Title = program_title + version_string; lblNumMissiles.Content = _rules_them_all.NumberMissiles.ToString(); _rules_them_all.ChangedTargets += on_targets_changed; _rules_them_all.sdCompleted += Search_Destroy_Complete; _rules_them_all._timer.TimeCaptured += new EventHandler<TimerEventArgs>(_timer_TimeCaptured); _video_plugins = new List<IVideoPlugin>(); // add video plugins to list here _video_plugins.Add(new DefaultVideo()); // set current plugin here. _eye_of_sauron = _video_plugins.First(); // setup resoultion information and event handler, start plugin. _eye_of_sauron.Width = (int)imgVideo.Width; _eye_of_sauron.Height = (int)imgVideo.Height; _eye_of_sauron.NewImage += new EventHandler(on_image_changed); _eye_of_sauron.Start(); // Mode List initialization cmbModes.ItemsSource = _rules_them_all.Modes; _rules_them_all.OutOfAmmo += on_out_of_ammo; _rules_them_all.AmmoReduced += On_Ammo_Reduced; this.Closing += MainWindow_Closing; }
public MainWindow() { InitializeComponent(); _rules_them_all = OperationsManager.OperationsManager.GetInstance(); this.DataContext = this._rules_them_all; string version_string = Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString(); string program_title = "ASML-McCallister Home Security "; this.Title = program_title + version_string; lblNumMissiles.Content = _rules_them_all.NumberMissiles.ToString(); _rules_them_all.ChangedTargets += on_targets_changed; _rules_them_all.sdCompleted += Search_Destroy_Complete; _rules_them_all._timer.TimeCaptured += new EventHandler<TimerEventArgs>(_timer_TimeCaptured); _video_plugins = new List<IVideoPlugin>(); bool PluginFunctioning = true; _detection_counter = 0; try { // add video plugins to list here _video_plugins.Add(new DefaultVideo()); } catch (Exception) { PluginFunctioning = false; } // fail silently if video is not present or does not work. if (PluginFunctioning == true) { // set current plugin here. _eye_of_sauron = _video_plugins.First(); _eye_of_sauron.NewImage += new EventHandler(on_image_changed); _eye_of_sauron.Start(); } // Mode List initialization cmbModes.ItemsSource = _rules_them_all.Modes; _rules_them_all.AmmoReduced += On_Ammo_Reduced; this.Closing += MainWindow_Closing; }
public MainWindow() { InitializeComponent(); _rules_them_all = OperationsManager.OperationsManager.GetInstance(); this.DataContext = this._rules_them_all; string version_string = Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString(); string program_title = "ASML-McCallister Home Security "; this.Title = program_title + version_string; lblNumMissiles.Content = _rules_them_all.NumberMissiles.ToString(); _rules_them_all.ChangedTargets += on_targets_changed; _video_plugins = new List<IVideoPlugin>(); // add plugins to list here _video_plugins.Add(new DefaultVideo()); // set current plugin here. _eye_of_sauron = _video_plugins.First(); _eye_of_sauron.Width = (int)imgVideo.Width; _eye_of_sauron.Height = (int)imgVideo.Height; _eye_of_sauron.NewImage += new EventHandler(on_image_changed); _eye_of_sauron.Start(); // Mode List initialization // lstModes.DataContext = _rules_them_all.SearchModeList }