Пример #1
0
 public void Dispose()
 {
     if (this.serialDevice != null && this.serialDevice.IsOpen)
     {
         this.End();
     }
     instance = null;
 }
Пример #2
0
 public static Wheelchair Instance(ISerialDevice serialDevice, string portName, int baudRate)
 {
     if (instance == null)
     {
         instance = new Wheelchair(serialDevice, portName, baudRate);
     }
     return(instance);
 }
Пример #3
0
 public static Wheelchair Instance(ISerialDevice serialDevice)
 {
     if (instance == null)
     {
         instance = new Wheelchair(serialDevice, null, 0);
     }
     return(instance);
 }
Пример #4
0
 public static Wheelchair Instance()
 {
     if (instance == null)
     {
         instance = new Wheelchair();
     }
     return(instance);
 }
Пример #5
0
        /// <summary>
        /// Gets the singleton instance of
        /// the Wheelchair.
        /// </summary>
        /// <param name="portName"></param>
        /// <param name="baudRate"></param>
        /// <returns>Singleton instance of the wheelchair.</returns>
        public static Wheelchair Instance(string portName = "COM7", int baudRate = 9600)
        {
            if (instance == null)
            {
                instance = new Wheelchair(portName, baudRate);
            }

            return(instance);
        }