Beispiel #1
0
        public void Handle(MatchOpenedEvent message)
        {
            // We must reconsider, whether we can generate a report now.

            this.NotifyOfPropertyChange(() => this.CanSaveMatch);
            this.NotifyOfPropertyChange(() => this.CanSaveMatchAs);
            this.NotifyOfPropertyChange(() => this.CanShowPlayer);
            this.NotifyOfPropertyChange(() => this.CanShowCompetition);
            MatchManager.Match.PropertyChanged              += SetMatchModified;
            MatchManager.Match.FirstPlayer.PropertyChanged  += SetMatchModified;
            MatchManager.Match.SecondPlayer.PropertyChanged += SetMatchModified;
            int countRallies = MatchManager.Match.Rallies.Count;

            for (int i = 0; i < countRallies; i++)
            {
                MatchManager.Match.Rallies[i].PropertyChanged += SetMatchModified;
                int countStrokes = MatchManager.Match.Rallies[i].Strokes.Count();
                for (int j = 0; j < countStrokes; j++)
                {
                    MatchManager.Match.Rallies[i].Strokes[j].PropertyChanged += SetMatchModified;
                    if (MatchManager.Match.Rallies[i].Strokes[j].Spin != null)
                    {
                        MatchManager.Match.Rallies[i].Strokes[j].Spin.PropertyChanged += SetMatchModified;
                    }
                    if (MatchManager.Match.Rallies[i].Strokes[j].Stroketechnique != null)
                    {
                        MatchManager.Match.Rallies[i].Strokes[j].Stroketechnique.PropertyChanged += SetMatchModified;
                    }
                    if (MatchManager.Match.Rallies[i].Strokes[j].Placement != null)
                    {
                        MatchManager.Match.Rallies[i].Strokes[j].Placement.PropertyChanged += SetMatchModified;
                    }
                }
            }
        }
Beispiel #2
0
        public void Handle(MatchOpenedEvent message)
        {
            //DeactivateItem(ActiveItem, true);
            // We must reconsider, whether we can generate a report now.
            NotifyOfPropertyChange(() => this.CanGenerateReport);
            NotifyOfPropertyChange(() => this.CanSaveMatch);
            NotifyOfPropertyChange(() => this.CanSaveMatchAs);
            NotifyOfPropertyChange(() => this.CanExportExcel);
            NotifyOfPropertyChange(() => this.CanShowPlayer);
            NotifyOfPropertyChange(() => this.CanShowCompetition);
            this.ActivateItem(new MatchViewModel(Events, IoC.GetAll <IResultViewTabItem>().OrderBy(i => i.GetOrderInResultView()), MatchManager, DialogCoordinator));

            var reportVm = new ReportSettingsViewModel(MatchManager, _reportGenerationQueueManager, Events);

            reportVm.GenerateReport();
            reportVm.DiscardViewModel(true);
        }