-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormItemIgnore.cs
More file actions
77 lines (67 loc) · 2.16 KB
/
Copy pathFormItemIgnore.cs
File metadata and controls
77 lines (67 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright © 2018-2024 ASM-SW
//asm-sw@outlook.com https://github.com/asm-sw
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DonorStatement
{
public partial class FormItemIgnore : Form
{
public FormItemIgnore()
{
InitializeComponent();
}
private void FormIgnoreItem_VisibleChanged(object sender, EventArgs e)
{
if (((System.Windows.Forms.Control)sender).Visible)
LoadListBox();
else
SaveSelected();
}
// set ItemListIgnore to contain items selected
private void SaveSelected()
{
FormMain.Config.ItemListIgnore.Clear();
foreach (string item in listItems.SelectedItems)
FormMain.Config.ItemListIgnore.Add(item);
}
// update listbox so that it contains items not selected in previous form and select items from the ItemListIgnore collection
private void LoadListBox()
{
listItems.Items.Clear();
FormMain.Config.ItemListIgnore.Sort();
foreach (string item in FormMain.Config.ItemListNotSelected)
{
listItems.Items.Add(item);
if (FormMain.Config.ItemListIgnore.BinarySearch(item) >= 0)
listItems.SelectedItems.Add(item);
}
}
private void CheckUnCheckAll(bool bSelect)
{
listItems.Visible = false;
if (bSelect)
{
for (int i = 0; i < listItems.Items.Count; i++)
listItems.SetSelected(i, true);
}
else
listItems.SelectedItems.Clear();
listItems.Visible = true;
}
private void buttonSelectAll_Click(object sender, EventArgs e)
{
CheckUnCheckAll(true);
}
private void buttonClearSelections_Click(object sender, EventArgs e)
{
CheckUnCheckAll(false);
}
}
}