예제 #1
0
        public void Add(TypeInstantiationInfo instantiationInfo, TypeInstantiation typeInstantiation)
        {
            ArgumentUtility.CheckNotNull("instantiationInfo", instantiationInfo);
            ArgumentUtility.CheckNotNull("typeInstantiation", typeInstantiation);

            _instantiations.Add(instantiationInfo, typeInstantiation);
        }
 public ConstructorOnTypeInstantiation(TypeInstantiation declaringType, ConstructorInfo constructor)
     : base(declaringType, ArgumentUtility.CheckNotNull("constructor", constructor).Attributes)
 {
     _constructor = constructor;
     _parameters  = constructor
                    .GetParameters()
                    .Select(p => new MemberParameterOnInstantiation(this, p)).Cast <ParameterInfo>().ToList().AsReadOnly();
 }
예제 #3
0
 public FieldOnTypeInstantiation(TypeInstantiation declaringType, FieldInfo field)
     : base(
         declaringType,
         ArgumentUtility.CheckNotNull("field", field).Name,
         ArgumentUtility.CheckNotNull("declaringType", declaringType).SubstituteGenericParameters(field.FieldType),
         field.Attributes)
 {
     _field = field;
 }
 public EventOnTypeInstantiation(
     TypeInstantiation declaringType,
     EventInfo event_,
     MethodOnTypeInstantiation addMethod,
     MethodOnTypeInstantiation removeMethod,
     MethodOnTypeInstantiation raiseMethod)
     : base(declaringType, event_.Name, event_.Attributes, addMethod, removeMethod, raiseMethod)
 {
     _event = event_;
 }
 public PropertyOnTypeInstantiation(
     TypeInstantiation declaringType,
     PropertyInfo property,
     MethodOnTypeInstantiation getMethod,
     MethodOnTypeInstantiation setMethod)
     : base(declaringType, property.Name, property.Attributes, getMethod, setMethod)
 {
     _property        = property;
     _indexParameters = property.GetIndexParameters().Select(p => new MemberParameterOnInstantiation(this, p))
                        .Cast <ParameterInfo>().ToList().AsReadOnly();
 }
예제 #6
0
 public MethodOnTypeInstantiation(TypeInstantiation declaringType, MethodInfo method)
     : base(
         declaringType,
         ArgumentUtility.CheckNotNull("method", method).Name,
         method.Attributes,
         GetGenericMethodDefinition(method),
         method.GetGenericArguments())
     // TODO 5450: also wrap generic parameter constraints.
 {
     _method          = method;
     _returnParameter = new MemberParameterOnInstantiation(this, method.ReturnParameter);
     _parameters      = method.GetParameters().Select(p => new MemberParameterOnInstantiation(this, p)).Cast <ParameterInfo>().ToList().AsReadOnly();
 }