3 using Example.RemoteAgents.GTKLinux.View;
6 namespace Example.RemoteAgents.GTKLinux
8 public partial class MainWindow: Gtk.Window
10 private readonly ViewImpl _view;
11 private static readonly Logger logger = LogManager.GetCurrentClassLogger();
13 public MainWindow () : base (Gtk.WindowType.Toplevel)
15 _view = new ViewImpl();
17 this.ButtonGetDate.Clicked += this.ButtonGetDateClicked;
18 this.SendDataButton.Clicked += this.SendDataButtonClicked;
21 protected void OnDeleteEvent (object sender, DeleteEventArgs a)
27 async private void ButtonGetDateClicked(object sender, EventArgs e)
30 this.RemoteDate.Buffer.Text = await _view.GetCurrentDateAsync();
32 catch (Exception exception)
34 logger.Error("ButtonGetDateClicked error: ", exception);
38 async private void SendDataButtonClicked(object sender, EventArgs e)
41 await _view.SetWriteTextAsync(this.TextToSend.Buffer.Text,
42 this.SpinButtonNumbers.Value);
44 catch (Exception exception)
46 logger.Error("SendDataButtonClicked error: ", exception);