Example #1
0
        public virtual void Add()
        {
            Trace.Call();

            ServerView serverView = new ServerView(_Parent, null, Frontend.Session.GetSupportedProtocols(), _Controller.GetNetworks());
            int res = serverView.Run();
            serverView.Destroy();
            if (res != (int) Gtk.ResponseType.Ok) {
                return;
            }

            _Controller.AddServer(serverView.Server);
            _Controller.Save();

            // refresh view
            Load();
        }
Example #2
0
        public virtual void Edit(ServerModel server)
        {
            Trace.Call(server);

            if (server == null) {
                throw new ArgumentNullException("server");
            }

            ServerView serverView = new ServerView(_Parent, server, Frontend.Session.GetSupportedProtocols(), _Controller.GetNetworks());
            int res = serverView.Run();
            serverView.Destroy();
            if (res != (int) Gtk.ResponseType.Ok) {
                return;
            }

            _Controller.SetServer(serverView.Server);
            _Controller.Save();

            // refresh the view
            Load();
        }