Beispiel #1
0
 public static DmdType ToDmdTypeNoNull(Type type, DmdAppDomain appDomain)
 {
     if (type is null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     return(appDomain.GetTypeThrow(type));
 }
Beispiel #2
0
 public static DmdType?ToDmdType(Type?type, DmdAppDomain appDomain)
 {
     if (type is null)
     {
         return(null);
     }
     return(appDomain.GetTypeThrow(type));
 }
Beispiel #3
0
 public static DmdType ToDmdType(Type type, DmdAppDomain appDomain)
 {
     if ((object)type == null)
     {
         return(null);
     }
     return(appDomain.GetTypeThrow(type));
 }
Beispiel #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);
        }
Beispiel #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);
        }