Exemple #1
0
 protected void Dispose(bool shouldDispose)
 {
     if ( shouldDispose )
     {
         // Dispose of the com port as safely as possible
         if ( port != null )
         {
             if( port.IsOpen )
                 port.Close();
             port.Dispose();
             port = null;
         }
     }
 }
 protected void Dispose(bool shouldDispose)
 {
     if (shouldDispose)
     {
         // Dispose of the com port as safely as possible
         if (port != null)
         {
             if (port.IsOpen)
             {
                 port.Close();
             }
             port.Dispose();
             port = null;
         }
     }
 }
 public ComPortProvider(string portName,
                        int baudRate = 57600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One)
 {
     port = new EnhancedSerialPort(portName, baudRate, parity, dataBits, stopBits);
 }
Exemple #4
0
 public ComPortProvider(string portName, 
     int baudRate = 57600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One)
 {
     port = new EnhancedSerialPort(portName,baudRate,parity,dataBits,stopBits);
 }