public Doctor_GUI(DoctorClient client) { this.client = client; Visible = true; InitializeComponent(); client.receivedVRData += updateVRdata; client.MessageNotifier += updateMessages; client.ConnectionsUpdate += RefreshConnections; client.historyNotifier += updateHistory; client.connectionCloseNotifier += closeWindow; MaximizeBox = false; FormBorderStyle = FormBorderStyle.FixedDialog; client.sendData(Commands.NOTIFYONNEWCONNECTED); bikeCommand.Text = standardTextBikeCommand; bikeCommand.ForeColor = Color.Gray; messager.Text = standardTextMessager; messager.ForeColor = Color.Gray; var speech = new SpeechSynthesizer(); speech.SpeakAsync("Hello" + client.name); startTraining.Text = "Start Training"; //this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; //this.Bounds = Screen.PrimaryScreen.Bounds; }
/// <summary> /// create a new doctor with his unique index /// </summary> /// <param name="index"></param> public static void createDoctor(string username = null, string password = null, TcpClient tcpclient = null, bool signed = false) { if (tcpclient == null) { tcpclient = connectSavely(); } if (tcpclient == null) { return; } var client = new DoctorClient(tcpclient); new Thread(client.checkForResponse).Start(); if (signed || ((username != null) && (password != null)) || login(client)) { if ((username != null) && (password != null)) { client.sendData(new Authentication(username, password, Authentication.Rights.DOCTOR)); } var GUI = new Doctor_GUI(client); Application.Run(GUI); } }
public void loadIdentifier(object focus) { if (focus is ClientIdentifier) { client.sendData(new Message(Commands.GETSTATS, focus)); current = BikeStatEvent.StatTypes.CURRENT_STATISTICS; linkLabel1.Visible = true; } if (focus is HistoryStats) { client.receivedAllBikeData.Invoke((HistoryStats)focus); linkLabel1.Visible = false; current = BikeStatEvent.StatTypes.COMBINED; updateLabels(((HistoryStats)focus).getCombined()); } }
private void button2_Click(object sender, EventArgs e) { client.sendData(new Forward(getSelectedBike().serverID, Commands.VR_AVAILABLE, null)); }