2 using System
.Collections
.Generic
;
3 using System
.ComponentModel
;
7 using System
.Windows
.Forms
;
12 public partial class RevisionChooser
: Form
15 public RevisionChooser()
17 InitializeComponent();
20 private void OnBranchSelected(object sender
, EventArgs e
)
22 m_tags
.SelectedIndex
= 0;
23 if (!String
.IsNullOrEmpty(m_branches
.SelectedItem
.ToString()))
25 m_statusTable
.Treeish
= ((Branch
)m_branches
.SelectedItem
);
26 m_statusTable
.RepopulateTable();
30 private void OnTagSelected(object sender
, EventArgs e
)
32 m_branches
.SelectedIndex
= 0;
33 if (!String
.IsNullOrEmpty(m_tags
.SelectedItem
.ToString()))
35 m_statusTable
.Treeish
= ((Tag
)m_tags
.SelectedItem
);
36 m_statusTable
.RepopulateTable();
40 public string Choose(Repo repo
)
43 m_statusTable
.SetRepo(m_currentRepo
);
44 m_branches
.Items
.Clear();
45 m_branches
.Items
.Add("");
46 m_branches
.Items
.AddRange(repo
.Branches
.ToArray());
49 m_tags
.Items
.AddRange(repo
.Tags
.ToArray());
50 if (DialogResult
.OK
== ShowDialog())
52 if (m_statusTable
.SelectedItems
.Count
== 1)
54 return ((Treeish
)m_statusTable
.SelectedItems
[0].Tag
).ID
;