private void RefreshHeapshotUIObjects()
{
this.hsRoots.Clear();
this.hsAllObjects.Clear();
foreach (HeapshotReader.ReferenceInfo info in this.heapshotReader.Roots)
{
string name = info.fieldInfo.name;
this.hsRoots.Add(new HeapshotUIObject(name, info.referencedObject, false));
}
SortedDictionary<string, List<HeapshotReader.ObjectInfo>> dictionary = new SortedDictionary<string, List<HeapshotReader.ObjectInfo>>();
foreach (HeapshotReader.ObjectInfo info2 in this.heapshotReader.Objects)
{
if (info2.type == HeapshotReader.ObjectType.Managed)
{
string key = info2.typeInfo.name;
if (!dictionary.ContainsKey(key))
{
dictionary.Add(key, new List<HeapshotReader.ObjectInfo>());
}
dictionary[key].Add(info2);
}
}
foreach (KeyValuePair<string, List<HeapshotReader.ObjectInfo>> pair in dictionary)
{
HeapshotReader.ObjectInfo refObject = new HeapshotReader.ObjectInfo();
HeapshotReader.FieldInfo field = new HeapshotReader.FieldInfo("(Unknown)");
foreach (HeapshotReader.ObjectInfo info5 in pair.Value)
{
refObject.references.Add(new HeapshotReader.ReferenceInfo(info5, field));
}
HeapshotUIObject item = new HeapshotUIObject(pair.Key + " x " + pair.Value.Count, refObject, false) {
IsDummyObject = true
};
this.hsAllObjects.Add(item);
}
}