private async Task sendkeystroke(int stroke) { try { if (address != "" && pinc != "") { var channel = GrpcChannel.ForAddress(address); var control = new GControl.GControlClient(channel); HelloReply reply = await control.DoSomethingAsync( new HelloRequest { Keycode = stroke, Authkey = pinc }); if (!reply.Back) { showerror(string.Format("Can't execute stroke {0}, look at server for logs!", stroke)); } } else { showerror("This Should not happend! You call without init"); } } catch (Exception e) { showerror(e.Message); } }
private async void writeout(object send, EventArgs xx) { try { string stroke = textinputW.Text; if (address != "" && pinc != "") { var channel = GrpcChannel.ForAddress(address); var control = new GControl.GControlClient(channel); HelloReply reply = await control.typeitAsync( new typesomething { Totype = stroke, Authkey = pinc }); if (!reply.Back) { showerror(string.Format("Can't execute type \"{0}\", look at server for logs!", stroke)); } else { textinputW.Text = ""; } } else { showerror("This Should not happend! You call without init"); } } catch (Exception e) { showerror(e.Message); } }
private async void connect(object send, EventArgs xx) { try { string inp = ConnectEntry.Text; string inpin = rgex(Connectpin.Text); if (inp != "" && inpin != "") { var control = new GControl.GControlClient(GrpcChannel.ForAddress(inp)); address = inp; pinc = inpin; ConnectButton.IsEnabled = false; HelloReply reply = await control.authorisationAsync( new auths { Authkey = pinc }); if (reply.Back) { ConnectButton.IsVisible = false; ConnectEntry.IsVisible = false; ConnectLabel.IsVisible = false; Connectpin.IsVisible = false; //DO SOME AUTH THINGS textinputB.IsVisible = true; textinputL.IsVisible = true; textinputW.IsVisible = true; ek.IsVisible = true; rk.IsVisible = true; fk.IsVisible = true; ck.IsVisible = true; wk.IsVisible = true; ak.IsVisible = true; sk.IsVisible = true; spacek.IsVisible = true; dk.IsVisible = true; onek.IsVisible = true; } else { showerror("Wrong Pin"); } ConnectButton.IsEnabled = true; } else { showerror("Enter valid things!"); } } catch (Exception e) { showerror(e.Message); } }