3 using System.Threading.Tasks;
4 using Example.RemoteAgents.GTKLinux.View;
7 namespace Example.RemoteAgents.GTKLinux
9 public partial class MainWindow: Gtk.Window
11 private readonly ViewImpl _view;
12 private static readonly Logger logger = LogManager.GetCurrentClassLogger();
14 public MainWindow () : base (Gtk.WindowType.Toplevel)
16 _view = new ViewImpl();
18 this.ButtonGetDate.Clicked += this.ButtonGetDateClicked;
19 this.SendDataButton.Clicked += this.SendDataButtonClicked;
22 protected void OnDeleteEvent (object sender, DeleteEventArgs a)
28 async private void ButtonGetDateClicked(object sender, EventArgs e)
31 this.RemoteDate.Buffer.Text = await _view.GetCurrentDateAsync();
33 catch (Exception exception)
35 logger.ErrorException("ButtonGetDateClicked error: ", exception);
39 async private void SendDataButtonClicked(object sender, EventArgs e)
42 await _view.SetWriteTextAsync(this.TextToSend.Buffer.Text,
43 this.SpinButtonNumbers.Value);
45 catch (Exception exception)
47 logger.ErrorException("SendDataButtonClicked error: ", exception);