コード例 #1
0
        public static IDList Read(ClrObject obj)
        {
            if (obj.IsNullObj)
            {
                return(null);
            }

            ClrObject idsRef = obj.GetRefFld("m_ids");

            if (idsRef.IsNullObj)
            {
                return(null);
            }

            List <ClrObject> ids = idsRef.Type?.Name?.Contains("ArrayList") == true?ClrCollectionHelper.EnumerateArrayList(idsRef) :
                                       ClrCollectionHelper.EnumerateListOfRefTypes(idsRef);

            var res = new IDList();

            foreach (ClrObject id in ids)
            {
                res.Add(IDReader.Read(id));
            }

            return(res);
        }
コード例 #2
0
        public override void Compute()
        {
            ClrAssert.ObjectNotNullTypeNotEmpty(this.Obj);

            this.Value = Obj.GetStringFld(fieldName: "_stringValue") ?? string.Empty;

            ClrObject multi = Obj.GetRefFld("_multiValue");

            if (multi.IsNullObj)
            {
                return;
            }

            ClrObject arrayList = multi.GetRefFld("_entriesArray");

            if (arrayList.IsNullObj)
            {
                return;
            }

            List <ClrObject> buckets = ClrCollectionHelper.EnumerateArrayList(arrayList);

            foreach (ClrObject bucket in buckets)
            {
                bucket.ReEvaluateType();
                ClrObject val = bucket.GetRefFld("Value");
                val.ReEvaluateType();
                if (val.IsNullObj)
                {
                    continue;
                }

                List <ClrObject> nestedValues = ClrCollectionHelper.EnumerateArrayList(val);
                foreach (ClrObject nestedValue in nestedValues)
                {
                    nestedValue.ReEvaluateType();
                    if (nestedValue.IsNullObj || (nestedValue.Type == null))
                    {
                        continue;
                    }

                    object tmpvalue = nestedValue.Type.GetValue(nestedValue.Address);
                    if (tmpvalue is string)
                    {
                        this.Value += tmpvalue;
                    }
                }
            }

            // var buckets = ClrCollectionHelper.EnumerateArrayOfRefTypes(arrayList);
            // buckets.
        }