コード例 #1
0
 public void SetFirstServer()
 {
     if (FirstServerPlayer1)
     {
         LiveView.firstServerBackup   = MatchManager.ConvertPlayer(MatchManager.Match.FirstPlayer);
         LiveView.Server              = MatchManager.ConvertPlayer(MatchManager.Match.FirstPlayer);
         LiveView.CurrentRally.Server = LiveView.Server;
         NotifyOfPropertyChange("LiveView.FirstServerBackup");
         NotifyOfPropertyChange("LiveView.Server");
         NotifyOfPropertyChange("LiveView.FirstServerSet");
         MatchManager.MatchModified = true;
     }
     else if (FirstServerPlayer2)
     {
         LiveView.firstServerBackup   = MatchManager.ConvertPlayer(MatchManager.Match.SecondPlayer);
         LiveView.Server              = MatchManager.ConvertPlayer(MatchManager.Match.SecondPlayer);
         LiveView.CurrentRally.Server = LiveView.Server;
         NotifyOfPropertyChange("LiveView.FirstServerBackup");
         NotifyOfPropertyChange("LiveView.Server");
         NotifyOfPropertyChange("LiveView.FirstServerSet");
         MatchManager.MatchModified = true;
     }
     else
     {
     }
 }
コード例 #2
0
        public IEnumerable <IResult> ShowServer()
        {
            var dialog = new CustomClosableComboDialog <Player>();

            dialog.CloseButton = new Button()
            {
                Content = "OK"
            };
            dialog.Combo = new ComboBox()
            {
                ItemsSource = Match.Players, SelectedIndex = 0, DisplayMemberPath = "Name"
            };
            StackPanel panel = new StackPanel()
            {
                Orientation = Orientation.Vertical
            };

            panel.Margin = new System.Windows.Thickness(10);
            TextBlock message = new TextBlock()
            {
                Text = "Bitte Aufschlagspieler auswählen"
            };

            panel.Children.Add(message);
            panel.Children.Add(dialog.Combo);
            panel.Children.Add(dialog.CloseButton);

            dialog.Content = panel;
            var result = new CustomDialogResult <Player>()
            {
                Title = "Server", DialogContent = dialog
            };

            yield return(result);


            NotifyOfPropertyChange("FirstServerSet");
            this.Server         = MatchManager.ConvertPlayer(result.Result);
            CurrentRally.Server = this.Server;
            NotifyOfPropertyChange("Server");
        }