!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Tools / Statoscope / Statoscope / LogControlDragDrop.cs
blobd4c6fc5d7561c97a958bacc74be20a22b7ebcb08
1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
3 using System.Windows.Forms;
5 namespace Statoscope
7 partial class LogControl
9 public void LogControl_DragEnter(object sender, DragEventArgs e)
11 LogControl sourceLogControl = GetDragEventSourceLogControl(e);
12 LogRange sourceLogRange = GetDragEventSourceLogRange(e);
14 if ((sourceLogControl != null && sourceLogControl != this) || sourceLogRange != null)
15 e.Effect = DragDropEffects.Copy;
16 else
17 m_statoscopeForm.StatoscopeForm_DragEnter(sender, e);
20 LogControl GetDragEventSourceLogControl(DragEventArgs e)
22 return (LogControl)e.Data.GetData(typeof(LogControl));
25 LogRange GetDragEventSourceLogRange(DragEventArgs e)
27 return (LogRange)e.Data.GetData(typeof(LogRange));
30 public void LogControl_DragDrop(object sender, DragEventArgs e)
32 LogControl sourceLogControl = GetDragEventSourceLogControl(e);
33 LogRange sourceLogRange = GetDragEventSourceLogRange(e);
35 if (sourceLogControl != null || sourceLogRange != null)
37 foreach (LogView logView in m_logViews)
39 logView.SetSingleOrdiColour(RGB.RandomHueRGB());
42 foreach (Control lliControl in logListTableLayoutPanel.Controls)
44 LogListItem lli = (LogListItem)lliControl;
45 lli.UpdateContents();
48 logListTableLayoutPanel.SuspendLayout();
50 if (sourceLogControl != null)
52 foreach (LogView logView in sourceLogControl.m_logViews)
54 FrameRecordRange frr = logView.m_logData == logView.m_baseLogData ? null : logView.m_logData.FrameRecordRange;
55 LogRange logRange = new LogRange(logView.m_baseLogData, frr);
56 AddNewLogRange(logRange);
59 else if (sourceLogRange != null)
61 AddNewLogRange(sourceLogRange);
64 logListTableLayoutPanel.ResumeLayout();
66 m_statoscopeForm.SetSessionInfoList(this);
68 RefreshItemInfoPanel();
69 UpdateControls(0);
70 SetUMTreeViewNodeColours();
72 foreach (LogView logView in m_logViews)
74 // this is required as in calculating value stats in UpdateControls(), an OnPaint could happen and use invalid data
75 logView.DeleteDisplayListsEndingIn(".MA");
76 logView.DeleteDisplayListsEndingIn(".LM");
79 else
81 m_statoscopeForm.StatoscopeForm_DragDrop(sender, e);