/// <summary>
        /// Method to go to the "Statistic" page
        /// </summary>
        /// <returns></returns>
        private async Task GoToStatistics()
        {
            StatisticsWindow page = new StatisticsWindow(UserServices, AlertServices, MaterialServices, ProductServices, MaterialsProductServices, SaleServices, await SaleServices.CountBySite(), await SaleServices.EvolutionByMonth(), await SaleServices.TotalMoneyEarn(), await SaleServices.MoneyByYear());

            page.Show();
            CurrentPage.Close();
        }
        private void createStatisticsWindow_Click(object sender, RoutedEventArgs e)
        {
            StatisticsWindow statisticWindow = new StatisticsWindow();

            statisticWindow.Show();
            this.Close();
        }
        private void OnStatisticsButtonCommandExecuted(object p)
        {
            StatisticsWindow statisticsWindow = new StatisticsWindow();

            statisticsWindow.Owner = Application.Current.MainWindow;
            statisticsWindow.Show();
        }
Exemple #4
0
        public WrapPanel GetRuntimePanel()
        {
            const int elementsHeight = 25;
            const int fontsSize      = 12;
            WrapPanel panel          = new WrapPanel();
            Button    statsButton    = new Button
            {
                Content  = "Show statistics",
                FontSize = fontsSize,
                Height   = elementsHeight
            };

            statsButton.Click += (o, e) =>
            {
                var stats          = statistics.GetStatistics();
                StatisticsWindow w = new StatisticsWindow(stats);
                w.ShowDialog();
            };

            managedButton          = new Button();
            managedButton.Width    = double.NaN;
            managedButton.Height   = elementsHeight;
            managedButton.FontSize = fontsSize;
            managedButton.Content  = "Start the break";
            managedButton.Click   += (o, e) => { BreakRequested(); StartBreak(); };

            managedText          = new TextBlock();
            managedText.Height   = elementsHeight;
            managedText.FontSize = fontsSize;
            managedText.Text     = "Break is available";
            panel.Children.Add(managedButton);
            panel.Children.Add(managedText);
            return(panel);
        }
Exemple #5
0
 private void OnSignUpSuccess(RegisterPlayFabUserResult obj)
 {
     StatisticsWindow.OnSetupPlayerStatistics();
     GameManager.m_playfabID = obj.PlayFabId;
     m_mainPanel.gameObject.SetActive(true);
     m_mainPanel.gameObject.SetActive(false);
     m_mainPanel.gameObject.SetActive(true);
     m_registrationForm.SetActive(false);
 }
 public void ShowStatsWindow(object sender)
 {
     _context.Send(_ =>
     {
         var window = new StatisticsWindow {
             DataContext = sender
         };
         window.ShowDialog();
     });
 }
    void OnStatisticsWindowActionActivated(object sender, System.EventArgs e)
    {
        if (!data.RomLoaded)
        {
            return;
        }

        var d = new StatisticsWindow(data);

        d.Show();
    }
        private void StatsMethod(object param)
        {
            int secondsRemaining = (deadline - DateTime.Now).Seconds;

            StopTimer();
            StatisticsWindow    statsWindow         = new StatisticsWindow();
            StatisticsViewModel statisticsViewModel = new StatisticsViewModel(currentUser);

            statsWindow.DataContext = statisticsViewModel;
            statsWindow.ShowDialog();
            StartTimer(secondsRemaining);
        }
 private void GetStatistics(object parameter)
 {
     try
     {
         StatisticsWindow wnd = new StatisticsWindow();
         wnd.ShowDialog();
     }
     catch (Exception ex)
     {
         System.Windows.MessageBox.Show(ex.Message);
     }
 }
Exemple #10
0
        public void StatisticsPressed(object param)
        {
            int seconds = (deadline - DateTime.Now).Seconds;

            StopTimer();
            StatisticsWindow    statisticsWindow = new StatisticsWindow();
            StatisticsViewModel statisticsVM     = new StatisticsViewModel(user);

            statisticsWindow.DataContext = statisticsVM;
            statisticsWindow.ShowDialog();
            StartTimer(seconds);
        }
Exemple #11
0
        private void btnViewStatistics_Click(object sender, RoutedEventArgs e)
        {
            if (_selectMatchId <= 0)
            {
                MessageBox.Show("请先选择对应的比赛!");
                return;
            }
            if (!_testStatisticsDic.ContainsKey(_selectMatchId))
            {
                MessageBox.Show("该比赛没有对应的统计数据!");
                return;
            }
            StatisticsWindow demo = new StatisticsWindow(_testStatisticsDic[_selectMatchId]);

            demo.Show();
        }
Exemple #12
0
        public MainWindow()
        {
            InitializeComponent();

            AudioManager = new AudioManager();

            AudioManager.OnTrackEnded += OnTrackEndedHandler; //Unsubscribe using Disposable pattern.

            MainWindowController = new MainWindowController(Dispatcher, AudioManager,
                                                            MusicPositionSlider, MasterVolumeSlider, TimelinePlaybackValue);

            StatisticsWindow = new StatisticsWindow(Dispatcher, FullTitleBox, ResultIdBox, LyricsOwnerIdBox,
                                                    RemotePathBox, TitleBox, TitleWithFeatureBox, UrlBox, ArtistNameBox, ArtistUrlBox,
                                                    ArtistImageUrlBox, ArtistIDBox, IsArtistVerifedBox, UnreviewedAnnotationsBox, ConcurrentsBox,
                                                    IsHotBox, PageViewsBox, LyricsBox);

            GeniusApiHandler = new APIHandler("3VESSI-JxeTMqgIxUlNpmU516qvCEzSKhHdbxi9966Jg1VPqOc_S5GQ8oljqYpkI");
        }
        private void StatisticsButton_Click(object sender, RoutedEventArgs e)
        {
            var allowViewStatistics = Model.UserSettings.ProfileRole == Model.ERole.Administrator ||
                                      Model.UserSettings.ProfileRole == Model.ERole.Accountant ||
                                      Model.UserSettings.ProfileRole == Model.ERole.Designer;

            if (allowViewStatistics)
            {
                var statistics = new StatisticsWindow();
                var fadeIn     = new DoubleAnimation()
                {
                    From     = 0,
                    To       = 1,
                    Duration = new Duration(statistics.AnimationDuration)
                };
                statistics.BeginAnimation(Window.OpacityProperty, fadeIn);
                statistics.ShowDialog();
            }
            ;
        }
Exemple #14
0
        private void btnViewStatistics_Click(object sender, RoutedEventArgs e)
        {
            if (_statisticsMatch == null)
            {
                MessageBox.Show("没有统计数据,请先创建比赛!");
                return;
            }

            if (_statisticsWindow == null)
            {
                //App.Current.MainWindow = this;
                App.Current.ShutdownMode        = ShutdownMode.OnMainWindowClose;
                _statisticsWindow               = new StatisticsWindow(_statisticsMatch);
                this.willHide                   = new WillHide(this.HideWin2);
                this._statisticsWindow.Closing += new CancelEventHandler(win2_Closing);
            }
            if (!hasShow)
            {
                _statisticsWindow.Init(_statisticsMatch);
            }
            hasShow = true;
            _statisticsWindow.Show();
        }
Exemple #15
0
        private void InitMessenger()
        {
            ServiceBus.Instance.Register <OpenNewCardOverViewMessage>(this, delegate()
            {
                CardOverviewWindow myWindow = new CardOverviewWindow();
                myWindow.ShowDialog();
            });

            ServiceBus.Instance.Register <OpenStatisticsWindowMessage>(this, delegate()
            {
                StatisticsWindow = new StatisticsWindow();
                StatisticsWindow.ShowDialog();
            });

            ServiceBus.Instance.Register <OpenLearningCardWindowMessage>(this, delegate()
            {
                LearningCardWindow = new LearningCardWindow();
                LearningCardWindow.ShowDialog();
            });

            ServiceBus.Instance.Register <OpenNewCardWindowMessage>(this, delegate()
            {
                NewCardWindow = new NewCardWindow();
                NewCardWindow.ShowDialog();
            });

            ServiceBus.Instance.Register <OpenNewTopicWindowMessage>(this, delegate()
            {
                NewTopicWindow = new NewTopicWindow();
                NewTopicWindow.ShowDialog();
            });

            Messenger.Instance.Register <OpenPrintWindowMessage>(this, delegate(OpenPrintWindowMessage message)
            {
                PrintWindow myPrintWindow       = new PrintWindow();
                myPrintWindow.Grid1.ItemsSource = ((DataGrid)message.Grid).ItemsSource;
                myPrintWindow.ShowDialog();
            });



            Messenger.Instance.Register <OpenStatisticsPanelMessage>(this, delegate(OpenStatisticsPanelMessage messageObject)
            {
                Frame statisticsFrame = StatisticsWindow.StatisticsFrame;
                switch (messageObject.PanelIndex)
                {
                case OpenStatisticsPanelMessage.HISTORY_PANEL:
                    statisticsFrame.Content = new StatisticsHistoryPanel();
                    break;

                case OpenStatisticsPanelMessage.TIME_PANEL:
                    statisticsFrame.Content = new StatisticsTimePanel();
                    break;

                case OpenStatisticsPanelMessage.QUALITY_PANEL:
                    statisticsFrame.Content = new StatisticsQualityPanel();
                    break;

                case OpenStatisticsPanelMessage.NO_PANEL:
                    statisticsFrame.Content = null;
                    break;
                }
            });

            Messenger.Instance.Register <OpenLearningCardPanelMessage>(this, delegate(OpenLearningCardPanelMessage messageObject)
            {
                Frame learningCardFrame = LearningCardWindow.LearningCardFrame;
                switch (messageObject.PanelIndex)
                {
                case OpenLearningCardPanelMessage.QUESTION_PANEL:
                    learningCardFrame.Content = new LearningCardQuestionPanel();
                    break;

                case OpenLearningCardPanelMessage.ANSWER_PANEL:
                    learningCardFrame.Content = new LearningCardAnswerPanel();
                    break;

                case OpenLearningCardPanelMessage.FINISH_PANEL:
                    learningCardFrame.Content = new LearningCardFinishPanel();
                    break;

                case OpenLearningCardPanelMessage.CLOSE_PANEL:
                    learningCardFrame.Content = "";
                    break;
                }
            });


            Messenger.Instance.Register <OpenTopicSelectionWindowMessage>(this, delegate(OpenTopicSelectionWindowMessage message)
            {
                StatisticsTopicSelectionWindow myWindow = new StatisticsTopicSelectionWindow();
                myWindow.ShowDialog();
            });

            Messenger.Instance.Register <SendAnswerMessage>(this, delegate(SendAnswerMessage message)
            {
            });
        }
 private void Statistics()
 {
     StatisticsWindow i = new StatisticsWindow();
     i.Show();
 }
        private void OpenStatistics()
        {
            statisticsWindow = new StatisticsWindow(Statistics);
            statisticsWindow.Closed += CloseStatisticsWindow;

            OpenStatisticsCommand.RaiseCanExecuteChanged();

            statisticsWindow.Show();
        }
        private void CloseStatisticsWindow(object sender, EventArgs e)
        {
            var window = (StatisticsWindow)sender;
            window.Closed -= CloseStatisticsWindow;
            statisticsWindow = null;

            OpenStatisticsCommand.RaiseCanExecuteChanged();
        }
        public void OpenStatistics()
        {
            IFactory <IColorGenerator> colorGeneratorFactory = Factory.Default <RandomColorGenerator>();

            ContainerCollection <ContainerCollection <StatisticsViewModel> > viewModel = new ContainerCollection <ContainerCollection <StatisticsViewModel> >();
            Stack <StatisticsViewModel> appendTo = new Stack <StatisticsViewModel>();

            Container <ContainerCollection <StatisticsViewModel> > allViewModel = new Container <ContainerCollection <StatisticsViewModel> >();

            allViewModel.Title = "All";
            allViewModel.Data  = new ContainerCollection <StatisticsViewModel>()
            {
                new Container <StatisticsViewModel>()
                {
                    Title = "All",
                    Data  = new StatisticsViewModel(colorGeneratorFactory.Create())
                }
            };
            appendTo.Push(allViewModel.Data[0].Data);
            viewModel.Add(allViewModel);

            foreach (IGrouping <int, Month> year in countingService.Months().OrderByDescending(m => m.Year).GroupBy(m => m.Year))
            {
                Container <ContainerCollection <StatisticsViewModel> > yearViewModel = new Container <ContainerCollection <StatisticsViewModel> >();
                yearViewModel.Title = year.Key.ToString();
                yearViewModel.Data  = new ContainerCollection <StatisticsViewModel>();

                yearViewModel.Data.Add(new Container <StatisticsViewModel>()
                {
                    Title = "All",
                    Data  = new StatisticsViewModel(colorGeneratorFactory.Create())
                });
                appendTo.Push(yearViewModel.Data[0].Data);

                foreach (Month month in year.OrderBy(m => m.Value))
                {
                    Container <StatisticsViewModel> monthViewModel = new Container <StatisticsViewModel>();
                    monthViewModel.Title = month.ToShortString();
                    monthViewModel.Data  = new StatisticsViewModel(colorGeneratorFactory.Create());

                    appendTo.Push(monthViewModel.Data);

                    foreach (ApplicationCountModel application in countingService.Applications(month, month))
                    {
                        appendTo.ForEach(vm => vm.AddApplication(application.Path, application.Count));
                    }

                    foreach (FileCountModel file in countingService.Files(month, month))
                    {
                        appendTo.ForEach(vm => vm.AddFile(file.Path, file.Count));
                    }

                    appendTo.Pop();
                    yearViewModel.Data.Add(monthViewModel);
                }

                appendTo.Pop();
                viewModel.Add(yearViewModel);
            }

            statisticsWindow           = new StatisticsWindow();
            statisticsWindow.ViewModel = viewModel;
            statisticsWindow.Owner     = configurationWindow;
            statisticsWindow.Closed   += OnStatisticsWindowClosed;
            statisticsWindow.ShowDialog();
        }
 private void OnStatisticsWindowClosed(object sender, EventArgs e)
 {
     statisticsWindow.Closed -= OnStatisticsWindowClosed;
     statisticsWindow         = null;
 }
Exemple #21
0
 void StatisticsWindow()
 {
     _ = new StatisticsWindow();
 }
        public void OpenStatisticsWindow(Window w)
        {
            StatisticsWindow window = new StatisticsWindow();

            window.ShowDialog();
        }
        public void ShowGetStatisticsWindow()
        {
            StatisticsWindow window = new StatisticsWindow(serviceManager);

            window.Show();
        }