/// <summary> /// 设置程序状态 /// </summary> /// <param name="state"></param> void SetAppState(EnAppState state) { enAppState = state; this.btnStart.Enabled = (enAppState == EnAppState.ST_STOPED); this.btnStop.Enabled = (enAppState == EnAppState.ST_STARTED); this.txtIpAddress.Enabled = (enAppState == EnAppState.ST_STOPED); this.txtPort.Enabled = (enAppState == EnAppState.ST_STOPED); this.txtDisConn.Enabled = (enAppState == EnAppState.ST_STARTED); this.btnDisconn.Enabled = (enAppState == EnAppState.ST_STARTED && this.txtDisConn.Text.Length > 0); }
/// <summary> /// 设置程序状态 /// </summary> /// <param name="state"></param> void SetAppState(EnAppState state) { enAppState = state; this.btnStart.Enabled = (enAppState == EnAppState.ST_STOPED); this.btnStop.Enabled = (enAppState == EnAppState.ST_STARTED); this.txtIpAddress.Enabled = (enAppState == EnAppState.ST_STOPED); this.txtPort.Enabled = (enAppState == EnAppState.ST_STOPED); this.cbxAsyncConn.Enabled = (enAppState == EnAppState.ST_STOPED); this.btnSend.Enabled = (enAppState == EnAppState.ST_STARTED); }