Пример #1
0
 public static DmdType ToDmdTypeNoNull(Type type, DmdAppDomain appDomain)
 {
     if (type is null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     return(appDomain.GetTypeThrow(type));
 }
Пример #2
0
 public static DmdType?ToDmdType(Type?type, DmdAppDomain appDomain)
 {
     if (type is null)
     {
         return(null);
     }
     return(appDomain.GetTypeThrow(type));
 }
Пример #3
0
 public static DmdType ToDmdType(Type type, DmdAppDomain appDomain)
 {
     if ((object)type == null)
     {
         return(null);
     }
     return(appDomain.GetTypeThrow(type));
 }
Пример #4
0
        public static DmdType[] ToDmdTypeNoNull(this IList <Type> types, DmdAppDomain appDomain)
        {
            if (types is null)
            {
                throw new ArgumentNullException(nameof(types));
            }
            if (types.Count == 0)
            {
                return(Array.Empty <DmdType>());
            }
            var newTypes = new DmdType[types.Count];

            for (int i = 0; i < newTypes.Length; i++)
            {
                newTypes[i] = appDomain.GetTypeThrow(types[i]);
            }
            return(newTypes);
        }
Пример #5
0
        public static DmdType[] ToDmdType(this IList <Type> types, DmdAppDomain appDomain)
        {
            if (types == null)
            {
                return(null);
            }
            if (types.Count == 0)
            {
                return(Array.Empty <DmdType>());
            }
            var newTypes = new DmdType[types.Count];

            for (int i = 0; i < newTypes.Length; i++)
            {
                newTypes[i] = appDomain.GetTypeThrow(types[i]);
            }
            return(newTypes);
        }