2 using System
.Collections
;
3 using System
.Collections
.Generic
;
4 using System
.ComponentModel
;
9 using System
.Windows
.Forms
;
12 namespace ExampleCsPlugin
14 partial class MyIssuesForm
: Form
16 private readonly IEnumerable
<TicketItem
> _tickets
;
17 private readonly List
<TicketItem
> _ticketsAffected
= new List
<TicketItem
>();
19 public MyIssuesForm(IEnumerable
<TicketItem
> tickets
)
21 InitializeComponent();
25 public IEnumerable
<TicketItem
> TicketsFixed
27 get { return _ticketsAffected; }
30 private void MyIssuesForm_Load(object sender
, EventArgs e
)
32 listView1
.Columns
.Add("");
33 listView1
.Columns
.Add("#");
34 listView1
.Columns
.Add("Summary");
36 foreach(TicketItem ticketItem
in _tickets
)
38 ListViewItem lvi
= new ListViewItem();
40 lvi
.SubItems
.Add(ticketItem
.Number
.ToString());
41 lvi
.SubItems
.Add(ticketItem
.Summary
);
44 listView1
.Items
.Add(lvi
);
47 listView1
.Columns
[0].Width
= -1;
48 listView1
.Columns
[1].Width
= -1;
49 listView1
.Columns
[2].Width
= -1;
52 private void okButton_Click(object sender
, EventArgs e
)
54 foreach (ListViewItem lvi
in listView1
.Items
)
56 TicketItem ticketItem
= lvi
.Tag
as TicketItem
;
57 if (ticketItem
!= null && lvi
.Checked
)
58 _ticketsAffected
.Add(ticketItem
);