1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
4 using System
.Collections
.Generic
;
5 using System
.ComponentModel
;
10 using System
.Windows
.Forms
;
14 partial class ProfilerItemInfoControl
: DesignableBasePIIC
16 public ProfilerItemInfoControl(LogControl logControl
, ProfilerRDI prdiTree
, RDICheckboxTreeView
<ProfilerRDI
> prdiCTV
)
17 : base(logControl
, prdiTree
, prdiCTV
)
19 InitializeComponent();
20 ItemPathLabel
= itemPathLabel
;
23 protected override ProfilerRDI RDI
29 itemPathLabel
.Text
= RDI
.Path
;
30 ItemPathLabelToolTip
.SetToolTip(itemPathLabel
, RDI
.Path
);
32 itemColourGroupBox
.Enabled
= (RDI
.IsLeaf
|| RDI
.IsCollapsed
);
33 itemColourButton
.BackColor
= RDI
.Colour
.ConvertToSysDrawCol();
34 itemColourGroupBox
.Show();
36 itemDescriptionLabel
.Text
= "Value: " + RDI
.LeafName
+ Environment
.NewLine
;
37 if (LogControl
.m_logViews
.Count
> 1)
39 EItemType itemType
= LogControl
.m_logViews
[0].m_baseLogData
.ItemMetaData
[RDI
.LeafPath
].m_type
;
40 bool itemTypeMatches
= true;
42 for (int i
= 0; i
< LogControl
.m_logViews
.Count
; i
++)
44 ItemMetaData itemMetaData
;
45 bool hasMetaData
= LogControl
.m_logViews
[i
].m_baseLogData
.ItemMetaData
.TryGetValue(RDI
.LeafPath
, out itemMetaData
);
46 if (hasMetaData
&& itemMetaData
.m_type
!= itemType
)
48 itemTypeMatches
= false;
53 itemDescriptionLabel
.Text
+= "Type: " + (itemTypeMatches
? (itemType
== EItemType
.Float
? "Float" : "Int") : "Mixed");
57 ItemMetaData itemMetaData
= LogControl
.m_logViews
[0].m_baseLogData
.ItemMetaData
[RDI
.LeafPath
];
58 itemDescriptionLabel
.Text
+= "Type: " + (itemMetaData
.m_type
== EItemType
.Float
? "Float" : "Int");
61 itemStatsGroupBox
.Hide();
62 itemStatsGroupBox
.Controls
.Clear();
63 itemStatsGroupBox
.Controls
.Add(new StatsListView(LogControl
.m_logViews
, RDI
.LeafPath
));
64 itemStatsGroupBox
.Enabled
= true;
65 itemStatsGroupBox
.Show();
69 protected override void SetItemColour(RGB colour
)
71 base.SetItemColour(colour
);
72 itemColourButton
.BackColor
= colour
.ConvertToSysDrawCol();
75 public override void OnLogChanged()
77 itemStatsGroupBox
.Invalidate(true);
80 private void itemColourButton_Click(object sender
, EventArgs e
)
82 ItemColourButton_Click();
85 private void itemColourRandomButton_Click(object sender
, EventArgs e
)
87 ItemColourRandomButton_Click();
91 class DesignableBasePIIC
: RDIInfoControl
<ProfilerRDI
>
93 public DesignableBasePIIC()
94 : this(null, null, null)
98 public DesignableBasePIIC(LogControl logControl
, ProfilerRDI prdiTree
, RDICheckboxTreeView
<ProfilerRDI
> prdiCTV
)
99 : base(logControl
, prdiTree
, prdiCTV
)