Exemple #1
0
        public void UnregisterDeviceLoopOperation(DeviceLoopOperation operation) 
        {
            if (!loopOps.Contains(operation))
                return;

            operation.Unregister();
            loopOps.Remove(operation);
        }
Exemple #2
0
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            if (mgr.IsRunning)
            {
                mgr.Stop();
            }
            else
            {
                mgr.Start();
            }

            if (op != null)
            {
                dev.UnregisterDeviceLoopOperation(op);
                op = null;
            }
            else
            {
                op = dev.RegisterDeviceLoopOperation(TestOperation, false);
            }

            bool running = mgr.IsRunning;
            UpdateDeviceDisplay();
            updateTimer.Enabled = running;
            btnStartStop.Text = running ? "Stop" : "Start";
        }
Exemple #3
0
 public DeviceLoopOperation RegisterDeviceLoopOperation(DeviceLoopOperationDelegate operation, bool isBlocking)
 {
     DeviceLoopOperation op = new DeviceLoopOperation(operation, isBlocking, this);
     loopOps.Add(op);
     op.Register();
     return op;
 }