Statically link ATL where needed
[TortoiseGit.git] / contrib / issue-tracker-plugins / ExampleCsPlugin / MyIssuesForm.cs
blob9bfa8cd143e3b68b308a833d6c3b6907d866c7f4
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4 using System.ComponentModel;
5 using System.Data;
6 using System.Drawing;
7 using System.Linq;
8 using System.Text;
9 using System.Windows.Forms;
10 using System.Xml;
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();
22 _tickets = tickets;
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();
39 lvi.Text = "";
40 lvi.SubItems.Add(ticketItem.Number.ToString());
41 lvi.SubItems.Add(ticketItem.Summary);
42 lvi.Tag = ticketItem;
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);