private void dumpCurrentEntriesToolStripMenuItem_Click(object sender, EventArgs e)
{
LBDebug.Controls.Clear();
try
{
string OutPut = ObjectCache.Objects.DumpDebugInfo();
LBDebug.Controls.Add(new UserControlDebugEntry(OutPut));
var SortedValues = ObjectCache.Objects.Values.OrderBy(obj => obj.targetType.Value).ThenBy(obj => obj.CentreDistance);
foreach (var item in SortedValues)
{
string objDebugStr = item.DebugString;
Color foreColor = (item is CacheItem) ? Color.Black : Color.GhostWhite;
Color backColor = (item is CacheDestructable) ? Color.DarkSlateGray
: (item is CacheUnit) ? Color.MediumSeaGreen
: (item is CacheItem) ? Color.Gold
: (item is CacheInteractable) ? Color.DimGray
: Color.Gray;
UserControlDebugEntry entry = new UserControlDebugEntry(objDebugStr, foreColor, backColor);
LBDebug.Controls.Add(entry);
}
}
catch
{
LBDebug.Controls.Add(new UserControlDebugEntry("End of Output due to Modification Exception"));
}
LBDebug.Focus();
}