Example #1
0
 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;
 }
Example #2
0
 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();
 }
Example #3
0
        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;
        }
Example #4
0
        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
        }
Example #5
0
        /// <summary>
        /// actual disposal method.
        /// </summary>
        /// <param name="dispose_others"></param>
        private void Dispose(bool dispose_others)
        {
            if (dispose_others == true)
            {
                _target_manager.Dispose();
                ((IDisposable)_turret).Dispose();

            }
            _rules_them_all = null;
        }
Example #6
0
 public static OperationsManager GetInstance()
 {
     if(_rules_them_all == null)
     {
         _rules_them_all = new OperationsManager();
     }
     return _rules_them_all;
 }
Example #7
0
 /// <summary>
 /// actual disposal method.
 /// </summary>
 /// <param name="dispose_others"></param>
 private void Dispose(bool dispose_others)
 {
     if (dispose_others == true)
     {
         _target_manager.Dispose();
         _turret.Dispose();// currently not disposable */
     }
     _rules_them_all = null;
 }