示例#1
0
 public RuntimeTypeSpec(ITypeResolver typeResolver,
     Type type,
     Func<IEnumerable<TypeSpec>> genericArguments = null)
     : base(typeResolver, type)
 {
     if (type == null)
         throw new ArgumentNullException("type");
     this.properties = CreateLazy(() => typeResolver.LoadProperties(this).ToList().AsReadOnly());
     this.interfaces = CreateLazy(() => typeResolver.LoadInterfaces(this).ToList().AsReadOnly());
     this.genericArguments =
         CreateLazy(genericArguments ?? (() => typeResolver.LoadGenericArguments(this).ToList().AsReadOnly()));
     runtimeTypeDetails = CreateLazy(() => typeResolver.LoadRuntimeTypeDetails(this));
     this.constructor = CreateLazy(() => typeResolver.LoadConstructor(this));
 }
示例#2
0
 public RuntimeTypeSpec(ITypeResolver typeResolver,
                        Type type,
                        Func <IEnumerable <TypeSpec> > genericArguments = null)
     : base(typeResolver, type)
 {
     if (type == null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     this.properties       = CreateLazy(() => typeResolver.LoadProperties(this).ToList().AsReadOnly());
     this.interfaces       = CreateLazy(() => typeResolver.LoadInterfaces(this).ToList().AsReadOnly());
     this.genericArguments =
         CreateLazy(genericArguments ?? (() => typeResolver.LoadGenericArguments(this).ToList().AsReadOnly()));
     this.runtimeTypeDetails = CreateLazy(() => typeResolver.LoadRuntimeTypeDetails(this));
     this.constructor        = CreateLazy(() => typeResolver.LoadConstructor(this));
 }