/// <summary> /// Compare the ComPort object specified by argument matches with self. /// </summary> /// <param name="ComPort">ComPort object to compare.</param> /// <returns>If matches, returns true, otherwise returns false.</returns> public bool Equals(ComPort ComPort) { try { if (this.Name.Equals(ComPort.Name) && this.Device.Equals(ComPort.Device)) { return(true); } else { return(false); } } catch (NullReferenceException ex) { Console.WriteLine(ex.Message); return(false); } }
/// <summary> /// Constructor /// </summary> /// <param name="ComPort">ComPort contains port name and its configuration.</param> public ComPortAccessSequenceRunner(ComPort ComPort) { this.SetComPort(ComPort); }
/// <summary> /// Open serial port specified by argument ComPort. /// The argument "ComPort is set to Property ComPort. /// </summary> /// <param name="ComPort">Serial port information to open.</param> /// <returns>Returns true if the port can open, else returns false.</returns> public bool Connect(ComPort ComPort) { this.ComPort = ComPort; return(this.Connect()); }
/// <summary> /// Constructor. /// </summary> /// <param name="ComPort"></param> public ComPortAccess(ComPort ComPort) { this.ComPort = ComPort; }