Ejemplo n.º 1
0
 public void Open()
 {
     try
     {
         if (!_device.IsConnected)
         {
             return;
         }
         _device.Open();
         _context.SetState(new OpenState(_device, _streamSplitter, _commandTranslator));
     }
     catch (IOException ex)
     {
         Debug.WriteLine("Could not open device");
         Debug.WriteLine(ex.Message);
         throw;
     }
 }
Ejemplo n.º 2
0
 public void Close()
 {
     _cts.Cancel();
     _device.Close();
     _context.SetState(new ClosedState(_device, _streamSplitter, _commandTranslator));
 }