@@ -21,11 +21,12 @@ public partial class DataTreeControl : UserControl, IToolTipProvider
21
21
private DataTreeModel _model ;
22
22
private static ViewerForm viewerForm ;
23
23
private ContextMenuStrip _contextMenuStrip ;
24
- private ToolStripMenuItem copyMenuItem , viewerMenuItem , watchMenuItem , copyIDMenuItem , copyTreeMenuItem ;
24
+ private ToolStripMenuItem copyMenuItem , viewerMenuItem , watchMenuItem , copyValueMenuItem , copyIDMenuItem , copyTreeMenuItem ;
25
25
private DataTreeState state ;
26
26
private bool watchMode ;
27
27
private bool addingNewExpression ;
28
- private static bool combineInherited = false ;
28
+ private static bool m_combineInherited = false ;
29
+ private static bool m_showStaticInObjects = true ;
29
30
30
31
public Collection < Node > Nodes
31
32
{
@@ -99,10 +100,11 @@ public DataTreeControl(bool watchMode)
99
100
this . NameTreeColumn . Header = TextHelper . GetString ( "Label.Name" ) ;
100
101
this . ValueTreeColumn . Header = TextHelper . GetString ( "Label.Value" ) ;
101
102
copyMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.Copy" ) , null , new EventHandler ( this . CopyItemClick ) ) ;
102
- copyIDMenuItem = new ToolStripMenuItem ( "Copy ID" , null , new EventHandler ( this . CopyItemIDClick ) ) ;
103
+ copyValueMenuItem = new ToolStripMenuItem ( "Copy Value" , null , new EventHandler ( this . CopyItemValueClick ) ) ;
104
+ copyIDMenuItem = new ToolStripMenuItem ( "Copy ID" , null , new EventHandler ( this . CopyItemIDClick ) ) ;
103
105
copyTreeMenuItem = new ToolStripMenuItem ( "Copy Tree" , null , new EventHandler ( this . CopyItemTreeClick ) ) ;
104
106
viewerMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.Viewer" ) , null , new EventHandler ( this . ViewerItemClick ) ) ;
105
- _contextMenuStrip . Items . AddRange ( new ToolStripMenuItem [ ] { copyMenuItem , copyIDMenuItem , copyTreeMenuItem , viewerMenuItem } ) ;
107
+ _contextMenuStrip . Items . AddRange ( new ToolStripMenuItem [ ] { copyMenuItem , copyIDMenuItem , copyValueMenuItem , copyTreeMenuItem , viewerMenuItem } ) ;
106
108
if ( watchMode )
107
109
watchMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.Unwatch" ) , null , new EventHandler ( this . WatchItemClick ) ) ;
108
110
else
@@ -389,10 +391,11 @@ public void ListChildItems(ValueNode node)
389
391
nodes . Add ( memberNode ) ;
390
392
}
391
393
}
394
+
392
395
// inherited vars
393
396
if ( inherited . Count > 0 )
394
397
{
395
- if ( combineInherited )
398
+ if ( m_combineInherited )
396
399
{
397
400
// list inherited alongside main class members
398
401
foreach ( DataNode item in inherited )
@@ -416,7 +419,7 @@ public void ListChildItems(ValueNode node)
416
419
}
417
420
418
421
// static vars
419
- if ( statics . Count > 0 )
422
+ if ( m_showStaticInObjects && statics . Count > 0 )
420
423
{
421
424
DataNode staticNode = new ValueNode ( "[static]" ) ;
422
425
statics . Sort ( ) ;
@@ -426,6 +429,7 @@ public void ListChildItems(ValueNode node)
426
429
}
427
430
node . Nodes . Add ( staticNode ) ;
428
431
}
432
+
429
433
// test children
430
434
foreach ( String ch in node . PlayerValue . getClassHierarchy ( false ) )
431
435
{
@@ -590,12 +594,6 @@ private void RestoreScrollState()
590
594
if ( topNode != null ) Tree . EnsureVisible ( topNode ) ;
591
595
}
592
596
}
593
-
594
- public static bool CombineInherited
595
- {
596
- get { return DataTreeControl . combineInherited ; }
597
- set { DataTreeControl . combineInherited = value ; }
598
- }
599
597
600
598
#region IToolTipProvider Members
601
599
@@ -633,8 +631,18 @@ private class DataTreeState
633
631
634
632
#endregion
635
633
636
-
637
- #region Copy ID & Tree
634
+ #region Copy Value, ID, Tree
635
+
636
+ private void CopyItemValueClick ( Object sender , System . EventArgs e )
637
+ {
638
+ if ( Tree . SelectedNode != null )
639
+ {
640
+
641
+ ValueNode node = Tree . SelectedNode . Tag as ValueNode ;
642
+ Clipboard . SetText ( node . Value ) ;
643
+
644
+ }
645
+ }
638
646
639
647
private void CopyItemIDClick ( Object sender , System . EventArgs e )
640
648
{
@@ -662,9 +670,47 @@ private void CopyTreeInternal(int levelLimit)
662
670
663
671
}
664
672
}
673
+
674
+ #endregion
665
675
676
+ #region Settings
666
677
667
- #endregion
678
+ public int CopyTreeMaxChars
679
+ {
680
+ get { return CopyTreeHelper . _CopyTreeMaxChars ; }
681
+ set { CopyTreeHelper . _CopyTreeMaxChars = value ; }
682
+ }
683
+ public int CopyTreeMaxRecursion
684
+ {
685
+ get { return CopyTreeHelper . _CopyTreeMaxRecursion ; }
686
+ set { CopyTreeHelper . _CopyTreeMaxRecursion = value ; }
687
+ }
688
+
689
+ public static bool CombineInherited
690
+ {
691
+ get { return DataTreeControl . m_combineInherited ; }
692
+ set { DataTreeControl . m_combineInherited = value ; }
693
+ }
694
+
695
+ public static bool ShowStaticInObjects
696
+ {
697
+ get { return DataTreeControl . m_showStaticInObjects ; }
698
+ set { DataTreeControl . m_showStaticInObjects = value ; }
699
+ }
700
+
701
+ public static bool ShowFullClasspaths
702
+ {
703
+ get { return ValueNode . m_ShowFullClasspaths ; }
704
+ set { ValueNode . m_ShowFullClasspaths = value ; }
705
+ }
706
+
707
+ public static bool ShowObjectIDs
708
+ {
709
+ get { return ValueNode . m_ShowObjectIDs ; }
710
+ set { ValueNode . m_ShowObjectIDs = value ; }
711
+ }
712
+
713
+ #endregion
668
714
669
715
}
670
716
0 commit comments