-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTreeListViewItem.cs
119 lines (96 loc) · 2.68 KB
/
TreeListViewItem.cs
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace P4EXP
{
public class TreeListViewItem : ListViewItem
{
internal bool Tagged { get; set; }
internal List<TreeListViewItem> ChildNodes;
public TreeListViewItem ParentItem { get; set; }
public int action1 { get; set; }
public int action2 { get; set; }
public bool firmer { get; set; }
public new bool Checked { get; set; }
public bool FullLine { get; set; }
public bool Expanded { get; set; }
/// <summary>
/// True if the item is visible in the tree because it is either a root node or
/// it's parent is expanded
/// </summary>
//public bool Displayed { get; set; }
public int treeStateImageIndex { get; set; }
public IList<int> LeftImageIndices { get; set; }
public IList<int> RightImageIndices { get; set; }
public IList<int> CenterImageIndices { get; set; }
public TreeListViewItem()
{
ParentItem = null;
Tagged = false;
FullLine = false;
//Displayed = false;
this.treeStateImageIndex = 0;
ChildNodes = new List<TreeListViewItem>();
LeftImageIndices = new List<int>();
RightImageIndices = new List<int>();
CenterImageIndices = new List<int>();
}
public TreeListViewItem(TreeListViewItem parentItem, string itemText, bool fullLine)
: base(itemText)
{
ParentItem = parentItem;
Tagged = false;
FullLine = fullLine;
//Displayed = false;
this.treeStateImageIndex = 0;
ChildNodes = new List<TreeListViewItem>();
LeftImageIndices = new List<int>();
RightImageIndices = new List<int>();
CenterImageIndices = new List<int>();
}
public TreeListViewItem(TreeListViewItem parentItem, params string[] items)
: base(items)
{
ParentItem = parentItem;
Tagged = false;
FullLine = false;
//Displayed = false;
this.treeStateImageIndex = 0;
ChildNodes = new List<TreeListViewItem>();
LeftImageIndices = new List<int>();
RightImageIndices = new List<int>();
CenterImageIndices = new List<int>();
}
public TreeListViewItem(TreeListViewItem parentItem, string[] items, int imageIndex)
: base(items, imageIndex)
{
ParentItem = parentItem;
Tagged = false;
FullLine = false;
//Displayed = false;
this.treeStateImageIndex = 0;
ChildNodes = new List<TreeListViewItem>();
LeftImageIndices = new List<int>();
RightImageIndices = new List<int>();
CenterImageIndices = new List<int>();
}
public void Expand()
{
if (ChildNodes.Count <= 0)
{
return;
}
this.treeStateImageIndex = 2;
}
public void Collapse()
{
if (ChildNodes.Count <= 0)
{
return;
}
this.treeStateImageIndex = 1;
}
}
}