public void ApplyConfig(UserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } var servers = new ServerListController(config); InitNetworks(servers.GetNetworks()); }
protected void OnAddServerActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); ServerDialog dialog = null; try { var controller = new ServerListController(Frontend.UserConfig); dialog = new ServerDialog(Parent, null, Frontend.Session.GetSupportedProtocols(), controller.GetNetworks()); int res = dialog.Run(); ServerModel server = dialog.GetServer(); if (res != (int) Gtk.ResponseType.Ok) { return; } controller.AddServer(server); controller.Save(); } catch (InvalidOperationException ex) { Frontend.ShowError(Parent, _("Unable to add server: "), ex); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } finally { if (dialog != null) { dialog.Destroy(); } } }