public ManagedObjectInstanceContentViewModel( [NotNull] IManagedObjectInstance instance) { this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); this.InstanceFields = this.instance.TypeDefinition.Fields .Where(f => !f.TypeInfo.IsStatic && !f.TypeInfo.IsConstant) .Select(f => new InstanceFieldViewModel(f, instance)) .ToArray(); }
public void DumpMemory(string previous, List <string> dump, List <uint> addresses, IManagedObjectInstance instance) { var currentNode = previous + this.definition.FullName; dump.Add(currentNode); //Console.WriteLine(currentNode); foreach (var field in this.StaticFields) { field.DumpMemory(currentNode + Crawler.SEPARATOR, dump, addresses); } var nonStatic = this.definition.Fields.Where(f => !f.TypeInfo.IsStatic && !f.TypeInfo.IsConstant) .Select(f => new InstanceFieldViewModel(f, instance)) .ToArray(); foreach (var field in nonStatic) { field.DumpMemory(currentNode + Crawler.SEPARATOR, dump, addresses); } }
public InstanceFieldViewModel([NotNull] IFieldDefinition field, [NotNull] IManagedObjectInstance instance) { this.field = field ?? throw new ArgumentNullException(nameof(field)); this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); }