void freshUnpackInfos() { if (_preUnpacked == null) { return; } _unpackedInfos = new UnPackedInfos(_unpacked, _preUnpacked); _unpackedInfos.calculateCrawledDict(); }
public void RefreshDiffData(CrawledMemorySnapshot unpackedCrawl, CrawledMemorySnapshot preUnpackedCrawl) { MemUtil.LoadSnapshotProgress(0.01f, "refresh Data"); _unpacked = unpackedCrawl; _preUnpacked = preUnpackedCrawl; resetDiffDicts(); _categories.Clear(); _staticDetailInfo.clear(); foreach (ThingInMemory thingInMemory in _unpacked.allObjects) { string typeName = MemUtil.GetGroupName(thingInMemory); if (typeName.Length == 0) { continue; } int category = MemUtil.GetCategory(thingInMemory); MemObject item = new MemObject(thingInMemory, _unpacked); MemCategory theCategory; if (!_categories.TryGetValue(category, out theCategory)) { theCategory = new MemCategory(); theCategory.Category = category; _categories.Add(category, theCategory); } theCategory.Size += item.Size; theCategory.Count++; } calculateCategoryInfo(); MemUtil.LoadSnapshotProgress(0.4f, "unpack all objs"); _unpackedInfos = new UnPackedInfos(_unpacked, _preUnpacked); _unpackedInfos.calculateCrawledDict(); List <ThingInMemory> addedList; List <ThingInMemory> unchangedList; List <ThingInMemory> removedList; getDiffDict(_unpackedInfos._unpackedThingsDict, _unpackedInfos._preunpackedThingsDict, out addedList, out removedList, out unchangedList); foreach (var thing in addedList) { _handleDiffObj(thing, sDiffType.AdditiveType, _unpacked); } foreach (var thing in removedList) { _handleDiffObj(thing, sDiffType.NegativeType, _unpacked); } foreach (var thing in unchangedList) { setUnchangedThings(thing); } MemUtil.LoadSnapshotProgress(0.8f, "check diff"); RefreshTables(); MemUtil.LoadSnapshotProgress(1.0f, "done"); }