void AddTemplatesToList() { for (int i = 0; i < templates.Count; i++) { AppTemplate t = templates[i]; appListView.Items.Add(new ListViewItem(t.Info.DisplayText) { Tag = t, ImageIndex = i, }); } }
private void selectButton_Click(object sender, EventArgs e) { if (appListView.SelectedItems.Count > 0) { AppTemplate t = (AppTemplate)appListView.SelectedItems[0].Tag; if (t.CanConfigure) { if (!t.Configure()) { return; } } selectedAppInfo = t.Info; DialogResult = DialogResult.OK; Close(); } }