/// <summary>
        /// Fill properties from the current match
        /// </summary>
        /// <param name="_CurrentMatch"></param>
        public void Fill(vmMatchState _CurrentMatch)
        {
            CurrentPointDescription = _CurrentMatch.CurrentPointDescription;
            NamePlayer1             = _CurrentMatch.NamePlayer1;
            NamePlayer2             = _CurrentMatch.NamePlayer2;
            ScorePlayer1            = _CurrentMatch.ScorePlayer1;
            ScorePlayer2            = _CurrentMatch.ScorePlayer2;
            PrintableScore          = _CurrentMatch.PrintableScore;
            Status           = _CurrentMatch.Status;
            MatchType        = _CurrentMatch.MatchType;
            Surface          = _CurrentMatch.Surface;
            Duration         = _CurrentMatch.Duration;
            Server           = _CurrentMatch.Server;
            Winner           = _CurrentMatch.Winner;
            InProgress       = _CurrentMatch.InProgress;
            Completed        = _CurrentMatch.Completed;
            Paused           = _CurrentMatch.Paused;
            IsExtendPossible = _CurrentMatch.IsExtendPossible;
            Undo             = _CurrentMatch.Undo;
            Switch           = _CurrentMatch.Switch;
            TotalSets        = new vmSetScore(_CurrentMatch.TotalSets);
            CurrentSetScore  = new vmSetScore(_CurrentMatch.CurrentSetScore);

            if (StatisticsCollection == null)
            {
                StatisticsCollection = _CurrentMatch.StatisticsCollection;
            }
            else
            {
                StatisticsCollection.Update(_CurrentMatch.StatisticsCollection);
            }

            Notify();
        }
 public vmStatistics(String _Description, TennisStatistics _Source, vmStatisticsCollection _Owner)
 {
     _StatisticElements = new List <vmStatistic>(0);
     Children           = new ObservableCollection <vmStatistic>();
     Description        = _Description;
     Owner = _Owner;
     SetSource(_Source);
 }
Exemple #3
0
        /// <summary>
        /// Update the statistics
        /// </summary>
        /// <param name="_vmSC"></param>
        public void Update(vmStatisticsCollection _vmSC)
        {
            Children.Clear();

            foreach (var Child in _vmSC.Children)
            {
                Children.Add(Child);

                if (Child.Description == Selected.Description)
                {
                    Selected = Child;
                }
            }

            Notify();
            NotifyPropertyChanged("VisibleElements");
        }
 public vmMatch()
 {
     CurrentPoint         = new vmPoint();
     StatisticsCollection = new vmStatisticsCollection();
     StoreMatch           = true;
 }