//========================================================================= //========================================================================= /// <summary> /// Instantiates a new RobotBase class with the passed in PortSettings. /// </summary> /// <param name="portSettings">The PortSettings for the underlying port.</param> public RobotBase(PortSettings portSettings) : this() { this.Configuration.PortSettings = portSettings; //---- make the changes to the underlying port this.UpdateUnderlyingPortSettings(); }
//========================================================================= //========================================================================= /// <summary> /// Instantiates a new RobotBase class with the passed in PortSettings. /// </summary> /// <param name="portSettings">The PortSettings for the underlying port.</param> public RobotBase(PortSettings portSettings) : this() { this.Configuration.PortSettings = portSettings; //---- make the changes to the underlying port this.UpdateUnderlyingPortSettings(); }
//======================================================================= //======================================================================= public RobotConfiguration(string displayName, bool hasCustomClass, bool hasCustomUI, PortSettings portSettings) : this() { this._displayName = displayName; this._hasCustomClass = hasCustomClass; this._hasCustomUI = hasCustomUI; this._portSettings = portSettings; }
//======================================================================= #endregion //======================================================================= #region ICloneable Members public object Clone() { //return this.MemberwiseClone(); PortSettings portSettings = new PortSettings(); portSettings.BaudRate = this.BaudRate; portSettings.DataBits = this.DataBits; portSettings.Handshake = this.Handshake; portSettings.Parity = this.Parity; portSettings.PortName = this.PortName; portSettings.StopBits = this.StopBits; return(portSettings as object); }
//======================================================================= //======================================================================= public RobotConfiguration(string displayName, bool hasCustomClass, bool hasCustomUI, PortSettings portSettings) : this() { this._displayName = displayName; this._hasCustomClass = hasCustomClass; this._hasCustomUI = hasCustomUI; this._portSettings = portSettings; }
public object Clone() { //return this.MemberwiseClone(); PortSettings portSettings = new PortSettings(); portSettings.BaudRate = this.BaudRate; portSettings.DataBits = this.DataBits; portSettings.Handshake = this.Handshake; portSettings.Parity = this.Parity; portSettings.PortName = this.PortName; portSettings.StopBits = this.StopBits; return portSettings as object; }