private void _OnSwitchRemoteEngineButtonClicked(object obj, EventArgs args) { Trace.Call(obj, args); try { Gtk.MessageDialog md = new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Switching the remote engine will disconnect you from the current engine!\n" + "Are you sure you want to do this?")); int result = md.Run(); md.Destroy(); if ((Gtk.ResponseType)result == Gtk.ResponseType.Yes) { Frontend.DisconnectEngineFromGUI(); Frontend.ShowEngineManagerDialog(); } } catch (Exception ex) { Frontend.ShowException(this, ex); } }
protected void OnSwitchRemoteEngineActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new Gtk.MessageDialog( Parent, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.YesNo, _("Switching the remote engine will disconnect you from the current engine!\n" + "Are you sure you want to do this?") ); int result = dialog.Run(); dialog.Destroy(); if ((Gtk.ResponseType)result == Gtk.ResponseType.Yes) { Frontend.DisconnectEngineFromGUI(); Frontend.ShowEngineManagerDialog(); } } catch (Exception ex) { Frontend.ShowException(Parent, ex); } }