public async void ExportFile()
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.FileName   = "CommitsFile";
            dlg.DefaultExt = ".csv";
            dlg.Filter     = "Csv documents (.csv)|*.csv";
            // Show save file dialog box
            bool?result = dlg.ShowDialog();

            // Process save file dialog box results
            if (result == true)
            {
                // Save document
                string        filename = dlg.FileName;
                List <Commit> tempList = CommitsCollection.ToList();
                DataToCsv.CreateCSVFromGitCommitsList(tempList, filename);

                await DialogHelper.Instance.ShowDialog(new CustomDialogEntryData()
                {
                    MetroWindow     = StaticServiceProvider.MetroWindowInstance,
                    DialogTitle     = this.GetLocalizedString("Information"),
                    DialogMessage   = this.GetLocalizedString("ExportMessage"),
                    OkButtonMessage = "Ok",
                    InformationType = InformationType.Information
                });
            }
        }
        private void RefreshList()
        {
            if (CommitsCollection != null && CommitsCollection.Any())
            {
                CommitsCollection.Clear();
            }

            using (var session = DbService.Instance.SessionFactory.OpenSession())
            {
                var commits = session.QueryOver <Commit>().List <Commit>();
                commits.ForEach(commit => CommitsCollection.Add(commit));
            }
        }
Beispiel #3
0
        private void ClearViewModel()
        {
            if (CommitsCollection != null && CommitsCollection.Any())
            {
                CommitsCollection.Clear();
            }
            if (ChangesCollection != null && ChangesCollection.Any())
            {
                ChangesCollection.Clear();
            }
            if (ChangePatchCollection != null && ChangePatchCollection.Any())
            {
                ChangePatchCollection.Clear();
            }

            CommitSelectedItem = new KeyValuePair <int, string>();
            ChangeSelectedItem = new Changes();
        }
 private void HandleDataMessage(List <Commit> list)
 {
     CommitsCollection.Clear();
     list.ForEach(x => CommitsCollection.Add(x));
 }