private System.Collections.IEnumerable _childrenGetter(object model) { Revision rev = model as Revision; return((System.Collections.Generic.IEnumerable <Revision>)rev.Parents); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (treeListView1.SelectedIndices.Count > 1) { Revision p1 = treeListView1.GetModelObject(treeListView1.SelectedIndices[0]) as Revision; Revision p2 = treeListView1.GetModelObject(treeListView1.SelectedIndices[1]) as Revision; SortedDictionary <string, saastdlib.pair <int, int> > paths = new SortedDictionary <string, saastdlib.pair <int, int> >(); System.Text.RegularExpressions.Regex egs_re = new System.Text.RegularExpressions.Regex("(.+)/EGS/(.*)", System.Text.RegularExpressions.RegexOptions.IgnoreCase | System.Text.RegularExpressions.RegexOptions.Compiled); Change[] changes = p1.cs.Changes; int cngCount = changes.Length; for (int i = 0; i < cngCount; ++i) { string path; System.Text.RegularExpressions.Match match = egs_re.Match(changes[i].Item.ServerItem); if (match != null) { path = match.Groups[2].Value; paths.Add(path, new saastdlib.pair <int, int>(i, -1)); } } changes = p2.cs.Changes; cngCount = changes.Length; for (int i = 0; i < changes.Length; ++i) { string path; System.Text.RegularExpressions.Match match = egs_re.Match(changes[i].Item.ServerItem); if (match != null) { path = match.Groups[2].Value; if (paths.ContainsKey(path)) { paths[path].second = i; } } } /* well, crap. now i need to remove all of the paths which have a -1 for the second item. */ List <string> removes = new List <string>(); foreach (KeyValuePair <string, saastdlib.pair <int, int> > item in paths) { if (item.Value.second == -1) { removes.Add(item.Key); } } foreach (string key in removes) { paths.Remove(key); } if (paths.Count > 0) { FileSelectionForm fsf = new FileSelectionForm(); fsf.Paths = paths; if (fsf.ShowDialog() == DialogResult.OK) { string key = fsf.SelectedPath; saastdlib.pair <int, int> items = paths[key]; /* * tfsinterface.Utils.VisualDiff * p1.ID, p2.ID, items); */ MessageBox.Show("run the 'VisualDiff' function."); } } else { MessageBox.Show("No files in common between the selected changesets."); } } }
private System.Collections.IEnumerable _childrenGetter(object model) { Revision rev = model as Revision; return(rev.getParents()); }