@@ -11,39 +11,27 @@ namespace ReClassNET.UI
1111{
1212 public partial class ClassNodeView : UserControl
1313 {
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-
2614 /// <summary>A custom tree node for class nodes with hierarchical structure.</summary>
2715 private class ClassTreeNode : TreeNode , IDisposable
2816 {
2917 public ClassNode ClassNode { get ; }
3018
31- private readonly ValueWrapper < bool > enableHierarchyView ;
32- private readonly ValueWrapper < bool > autoExpand ;
19+ private readonly ValueTypeWrapper < bool > enableHierarchyView ;
20+ private readonly ValueTypeWrapper < bool > autoExpand ;
3321
3422 /// <summary>Constructor of the class.</summary>
3523 /// <param name="node">The class node.</param>
3624 /// <param name="enableHierarchyView">The value if the hierarchy view is enabled.</param>
3725 /// <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 )
3927 : this ( node , enableHierarchyView , autoExpand , null )
4028 {
4129 Contract . Requires ( node != null ) ;
4230 Contract . Requires ( enableHierarchyView != null ) ;
4331 Contract . Requires ( autoExpand != null ) ;
4432 }
4533
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 )
4735 {
4836 Contract . Requires ( node != null ) ;
4937 Contract . Requires ( enableHierarchyView != null ) ;
@@ -126,8 +114,8 @@ private void RebuildClassHierarchy(HashSet<ClassNode> seen)
126114 }
127115
128116 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 ;
131119
132120 private ReClassNetProject project ;
133121
@@ -198,8 +186,8 @@ public ClassNodeView()
198186
199187 DoubleBuffered = true ;
200188
201- enableHierarchyView = new ValueWrapper < bool > ( true ) ;
202- autoExpand = new ValueWrapper < bool > ( false ) ;
189+ enableHierarchyView = new ValueTypeWrapper < bool > ( true ) ;
190+ autoExpand = new ValueTypeWrapper < bool > ( false ) ;
203191
204192 classesTreeView . ImageList = new ImageList ( ) ;
205193 classesTreeView . ImageList . Images . Add ( Properties . Resources . B16x16_Text_List_Bullets ) ;
0 commit comments