@@ -11,39 +11,27 @@ namespace ReClassNET.UI
11
11
{
12
12
public partial class ClassNodeView : UserControl
13
13
{
14
- /// <summary>A wrapper for non reference types.</summary>
15
- /// <typeparam name="T">Generic type parameter.</typeparam>
16
- private class ValueWrapper < T > where T : struct
17
- {
18
- public ValueWrapper ( T value )
19
- {
20
- Value = value ;
21
- }
22
-
23
- public T Value { get ; set ; }
24
- }
25
-
26
14
/// <summary>A custom tree node for class nodes with hierarchical structure.</summary>
27
15
private class ClassTreeNode : TreeNode , IDisposable
28
16
{
29
17
public ClassNode ClassNode { get ; }
30
18
31
- private readonly ValueWrapper < bool > enableHierarchyView ;
32
- private readonly ValueWrapper < bool > autoExpand ;
19
+ private readonly ValueTypeWrapper < bool > enableHierarchyView ;
20
+ private readonly ValueTypeWrapper < bool > autoExpand ;
33
21
34
22
/// <summary>Constructor of the class.</summary>
35
23
/// <param name="node">The class node.</param>
36
24
/// <param name="enableHierarchyView">The value if the hierarchy view is enabled.</param>
37
25
/// <param name="autoExpand">The value if nodes should get expanded.</param>
38
- public ClassTreeNode ( ClassNode node , ValueWrapper < bool > enableHierarchyView , ValueWrapper < bool > autoExpand )
26
+ public ClassTreeNode ( ClassNode node , ValueTypeWrapper < bool > enableHierarchyView , ValueTypeWrapper < bool > autoExpand )
39
27
: this ( node , enableHierarchyView , autoExpand , null )
40
28
{
41
29
Contract . Requires ( node != null ) ;
42
30
Contract . Requires ( enableHierarchyView != null ) ;
43
31
Contract . Requires ( autoExpand != null ) ;
44
32
}
45
33
46
- private ClassTreeNode ( ClassNode node , ValueWrapper < bool > enableHierarchyView , ValueWrapper < bool > autoExpand , HashSet < ClassNode > seen )
34
+ private ClassTreeNode ( ClassNode node , ValueTypeWrapper < bool > enableHierarchyView , ValueTypeWrapper < bool > autoExpand , HashSet < ClassNode > seen )
47
35
{
48
36
Contract . Requires ( node != null ) ;
49
37
Contract . Requires ( enableHierarchyView != null ) ;
@@ -126,8 +114,8 @@ private void RebuildClassHierarchy(HashSet<ClassNode> seen)
126
114
}
127
115
128
116
private readonly TreeNode root ;
129
- private readonly ValueWrapper < bool > enableHierarchyView ;
130
- private readonly ValueWrapper < bool > autoExpand ;
117
+ private readonly ValueTypeWrapper < bool > enableHierarchyView ;
118
+ private readonly ValueTypeWrapper < bool > autoExpand ;
131
119
132
120
private ReClassNetProject project ;
133
121
@@ -198,8 +186,8 @@ public ClassNodeView()
198
186
199
187
DoubleBuffered = true ;
200
188
201
- enableHierarchyView = new ValueWrapper < bool > ( true ) ;
202
- autoExpand = new ValueWrapper < bool > ( false ) ;
189
+ enableHierarchyView = new ValueTypeWrapper < bool > ( true ) ;
190
+ autoExpand = new ValueTypeWrapper < bool > ( false ) ;
203
191
204
192
classesTreeView . ImageList = new ImageList ( ) ;
205
193
classesTreeView . ImageList . Images . Add ( Properties . Resources . B16x16_Text_List_Bullets ) ;
0 commit comments