Beispiel #1
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();
        }
Beispiel #2
0
        private void CommitSelection(KeyValuePair <int, string> dictionary)
        {
            if (ChangesCollection != null && ChangesCollection.Count > 0)
            {
                ChangesCollection.Clear();
            }
            if (ChangePatchCollection != null && ChangePatchCollection.Any())
            {
                ChangePatchCollection.Clear();
            }

            using (var session = DbService.Instance.SessionFactory.OpenSession())
            {
                var changes = session.QueryOver <Changes>().Where(change => change.Commit.Id == dictionary.Key).List <Changes>();
                changes.ForEach(change =>
                {
                    ChangesCollection.Add(change);
                });
            }
        }