예제 #1
0
        private void SaveTournaments()
        {
            var settings = new UserSettings();
            var filename = _saveFileDialogService.ShowSaveFileDialog();

            if (!string.IsNullOrEmpty(filename))
            {
                _tournamentRepository.SaveAsXml(filename);
                _infoDialogService.ShowDialog(new InfoDialogViewModel("Turnaukset tallennettu tiedostoon " + filename));
            }
        }
예제 #2
0
        private void ClearSessions()
        {
            bool confirmed = false;

            Messenger.Default.Register <NotificationMessage>(this, message =>
            {
                if (message.Notification == "InfoDialogConfirmed")
                {
                    confirmed = true;
                }
            });

            _infoDialogService.ShowDialog(new InfoDialogViewModel("Haluatko varmasti tyhjentää kaikki käteispelitiedot?", showCancelButton: true));

            Messenger.Default.Unregister <NotificationMessage>(this);

            if (confirmed)
            {
                _sessionRepository.RemoveAll();
                PlayingSessions        = PlayingSession.GroupToPlayingSessions(_sessionRepository.GetAll());
                SelectedPlayingSession = null;
                _infoDialogService.ShowDialog(new InfoDialogViewModel("Käteissessiot tyhjennetty"));
            }
        }