public void GetConnectStatus(object sender, EventArgs e) { ConnectStatusEvent arg = (ConnectStatusEvent)e; UnitConnectStatus = arg.UnitConnectStatus; StationConnectStatus = arg.ConnectStatus; }
//Button_Paint_Event_Stop //Customize_Function_Start public void GetConnectStatus(object sneder, EventArgs e) { ConnectStatusEvent arg = (ConnectStatusEvent)e; switch (arg.authority) { case "管理員": if (arg.ConnectStatus == "與試車站連線中斷" || arg.ConnectStatus == "未與試車站建立連結") { Btn_StationConnect.Enabled = true; Btn_StationDisconnect.Enabled = false; } else { Btn_StationConnect.Enabled = false; Btn_StationDisconnect.Enabled = true; } Txt_UnitIP.Enabled = true; Txt_UnitPort.Enabled = true; Txt_StationIP.Enabled = true; Txt_StationPort.Enabled = true; break; case "操作者": if (arg.ConnectStatus == "與試車站連線中斷" || arg.ConnectStatus == "未與試車站建立連結") { Btn_StationConnect.Enabled = true; Btn_StationDisconnect.Enabled = false; } else { Btn_StationConnect.Enabled = false; Btn_StationDisconnect.Enabled = true; } Txt_UnitIP.Enabled = true; Txt_UnitPort.Enabled = true; break; case "訪客": Btn_StationConnect.Enabled = false; Btn_StationDisconnect.Enabled = false; Btn_UnitConnect.Enabled = false; Btn_UnitDisconnect.Enabled = false; break; } }