private bool InitCommand(SerialCommand command) { Byte slaveAddress; if (!Byte.TryParse(txtSlaveAddress.Text, out slaveAddress)) { Log("Error: Invalid slave address.", Color.Red); return(false); } command.SlaveAddress = slaveAddress; command.OnSend += new EventHandler <LogEventArgs>(LogSend); command.OnReceive += new EventHandler <LogEventArgs>(LogReceive); command.OnError += new EventHandler <ErrorEventArgs>(LogError); return(true); }
private bool InitCommand(SerialCommand command) { Byte slaveAddress; if (!Byte.TryParse(txtSlaveAddress.Text, out slaveAddress)) { Log("Error: Invalid slave address.", Color.Red); return false; } command.SlaveAddress = slaveAddress; command.OnSend += new EventHandler<LogEventArgs>(LogSend); command.OnReceive += new EventHandler<LogEventArgs>(LogReceive); command.OnError += new EventHandler<ErrorEventArgs>(LogError); return true; }