Esempio n. 1
0
        public static IEnumerable <ClrDynamic> EnumerateDynamicObjects(this ClrHeap heap, IEnumerable <ClrType> types)
        {
            if (types == null)
            {
                return(heap.EnumerateDynamicObjects());
            }

            IList <ClrType> castedTypes = types as IList <ClrType> ?? types.ToList();

            if (castedTypes.Count == 0)
            {
                return(heap.EnumerateDynamicObjects());
            }

            if (castedTypes.Count == 1)
            {
                return(heap.EnumerateDynamicObjects(castedTypes[0]));
            }

            HashSet <ClrType> set = new HashSet <ClrType>(castedTypes);

            return(from address in heap.EnumerateObjectAddresses()
                   let type = heap.GetSafeObjectType(address)
                              where set.Contains(type)
                              select new ClrDynamic(address, type));
        }
Esempio n. 2
0
 public static IEnumerable <ClrDynamic> EnumerateDynamicObjects(this ClrHeap heap, params ClrType[] types)
 {
     return(heap.EnumerateDynamicObjects((IEnumerable <ClrType>)types));
 }