Esempio n. 1
0
        private void MenuItem_Create_Click(object sender, RoutedEventArgs e)
        {
            var server     = NewsServerConnectionData.NewDefaultConnection;
            var serverEdit = new ServerEditWindow();

            serverEdit.Owner       = Window.GetWindow(this);
            serverEdit.DataContext = server;
            bool?res = serverEdit.ShowDialog();

            if (res.Value && serverEdit.MessageView.Result == WPFMessageViewResult.Ok)
            {
                NewsServerCollection.Add(server);
            }
        }
Esempio n. 2
0
        public void AddUsenetServer()
        {
            var server     = NewsServerConnectionData.NewDefaultConnection;
            var serverEdit = new ServerEditWindow();

            serverEdit.Owner       = Window.GetWindow(this);
            serverEdit.DataContext = server;
            bool?res = serverEdit.ShowDialog();

            if (res.Value && serverEdit.MessageView.Result == WPFMessageViewResult.Ok)
            {
                _model.NewsServerCollection.Add(server);
            }
        }
Esempio n. 3
0
        private void EditServer(int idx, NewsServer server)
        {
            var serverCopy = new NewsServerConnectionData(server.ServerConnection);
            var serverEdit = new ServerEditWindow();

            serverEdit.Owner       = Window.GetWindow(this);
            serverEdit.DataContext = serverCopy;
            bool?res = serverEdit.ShowDialog();

            if (res.Value && serverEdit.MessageView.Result == WPFMessageViewResult.Ok)
            {
                NewsServerCollection.Change(idx, serverCopy);
            }
        }