Example #1
0
        /// <summary>
        ///  Start and stop a process watcher.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        ///
        private void startStopItem_Click(object sender, EventArgs e)
        {
            if (processWatcher == null)
            {
                string processName = "Skype";
                processWatcher             = new ProcessWatcher(processName, 0.5);
                processWatcher.Started    += Process_Started;
                processWatcher.Terminated += Process_Terminated;

                titleTrackers = new Dictionary <int, TitleTracker>();

                Process[] processes = Process.GetProcessesByName(processName);
                log.Info("Running \"" + processName + "\" process instances: " + processes.Length);

                foreach (var process in processes)
                {
                    log.Info("Process id: " + process.Id);
                    TitleTracker titleTracker = new TitleTracker((uint)process.Id);
                    titleTracker.TitleChanged += TitleTracker_TitleChanged;
                    titleTrackers.Add(process.Id, new TitleTracker((uint)process.Id));
                }

                processWatcher.Start();
                startStopItem.Text = "Stop process watcher";
            }
            else
            {
                processWatcher.Dispose();
                processWatcher     = null;
                startStopItem.Text = "Start process watcher";
            }
        }
 public CollectFlightData(float requiredData, string partName)
 {
     this.requiredData    = requiredData;
     this.partName        = partName;
     disableOnStateChange = false;
     titleTracker         = new TitleTracker(this);
 }
        public SubRequirementParameter(SubRequirement subRequirement)
        {
            titleTracker = new TitleTracker(this);

            this.subRequirement     = subRequirement;
            this.requirementId      = subRequirement.parent.name;
            this.subRequirementType = subRequirement.type;
            optional = true;
        }
        public VesselStatusParameter(Vessel vessel, string statusLabel, bool conditionMet)
        {
            titleTracker = new TitleTracker(this);

            this.vessel       = vessel;
            this.statusLabel  = statusLabel;
            this.conditionMet = conditionMet;
            this.obsolete     = false;
        }
        public DurationParameter(double duration, double allowedDowntime, bool allowReset, double waitDuration, DurationType durationType)
        {
            titleTracker = new TitleTracker(this);

            this.duration        = duration;
            this.allowedDowntime = allowedDowntime;
            this.allowReset      = allowReset;
            this.waitDuration    = waitDuration;
            this.durationType    = durationType;
        }
Example #6
0
        public Test()
        {
            _processes = Process.GetProcessesByName(PROCESS_NAME);

            if (_processes.Length > 0)
            {
                skype = _processes[0];
            }

            titleTracker = new TitleTracker((uint)skype.Id);
        }
 public DurationParameter()
 {
     titleTracker = new TitleTracker(this);
 }
 public VesselStatusParameter()
 {
     titleTracker = new TitleTracker(this);
 }
Example #9
0
 public ContractConfiguratorParameter(string title)
 {
     this.title   = title;
     titleTracker = new TitleTracker(this);
 }
Example #10
0
 public ContractConfiguratorParameter()
     : this(null)
 {
     titleTracker = new TitleTracker(this);
 }
 public SubRequirementParameter()
 {
     titleTracker = new TitleTracker(this);
 }