Exemplo n.º 1
0
        public static void listenProcessesTermination(ProcessStopEvent handler)
        {
            processStopHandler = handler;
            ManagementEventWatcher stopWatch = new ManagementEventWatcher(
                new WqlEventQuery("SELECT * FROM Win32_ProcessStopTrace"));

            stopWatch.EventArrived += new EventArrivedEventHandler(stopWatch_EventArrived);
            stopWatch.Start();
        }
Exemplo n.º 2
0
        private void _stepController_StepReached(object sender, int stepNo)
        {
            _stepController.StopStep();

            if (_stepCount >= _recipe.Steps.Count)
            {
                // done....
                ProcessStopEvent?.Invoke(sender, stepNo);
            }
            else
            {
                var step = _recipe.Steps[_stepCount];
                _stepController.StartStep(step);
                Logger.Log(_logfilePathHeader, $"Auto next step:{step.Name},StepNo:{step.SortOrder},Time:{DateTime.Now}");
                _stepCount++;
            }
        }