internal AttributeGen(AttributeTargets target, AttributeType attributeType, object[] args) { if (args != null) { foreach (object arg in args) { CheckValue(arg); } } // TODO: target validation this.attributeType = attributeType; Operand[] argOperands; if (args == null || args.Length == 0) { this.args = EmptyArray<object>.Instance; argOperands = Operand.EmptyArray; } else { this.args = args; argOperands = new Operand[args.Length]; for (int i = 0; i < args.Length; i++) { argOperands[i] = GetOperand(args[i]); } } this.ctor = TypeInfo.FindConstructor(attributeType, argOperands); }
public AttributeGen<FieldGen> BeginAttribute(AttributeType type) { return BeginAttribute(type, EmptyArray<object>.Instance); }
public EventGen Attribute(AttributeType type) { BeginAttribute(type); return this; }
public AttributeGen<AssemblyGen> BeginModuleAttribute(AttributeType type) { return BeginModuleAttribute(type, EmptyArray<object>.Instance); }
public AssemblyGen ModuleAttribute(AttributeType type) { BeginModuleAttribute(type); return this; }
public PropertyGen Attribute(AttributeType type) { BeginAttribute(type); return this; }
public AttributeGen <DelegateGen> BeginAttribute(AttributeType type, params object[] args) { return(AttributeGen <DelegateGen> .CreateAndAdd(this, ref customAttributes, AttributeTargets.Delegate, type, args)); }
public DelegateGen Attribute(AttributeType type, params object[] args) { BeginAttribute(type, args); return(this); }
public ParameterGen Attribute(AttributeType type) { BeginAttribute(type); return(this); }
public abstract AttributeGen <T> BeginAttribute(AttributeType type, params object[] args);
public abstract AttributeGen <T> BeginAttribute(AttributeType type);
public abstract T Attribute(AttributeType type, params object[] args);
public abstract T Attribute(AttributeType type);
public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type, params object[] args) { return(AttributeGen <AssemblyGen> .CreateAndAdd(this, ref _moduleAttributes, AttributeTargets.Module, type, args, TypeMapper)); }
public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type) { return(BeginModuleAttribute(type, EmptyArray <object> .Instance)); }
public FieldGen Attribute(AttributeType type) { BeginAttribute(type); return this; }
public AssemblyGen ModuleAttribute(AttributeType type, params object[] args) { BeginModuleAttribute(type, args); return(this); }
public ParameterGen Attribute(AttributeType type, params object[] args) { BeginAttribute(type, args); return(this); }
public AttributeGen <DelegateGen> BeginAttribute(AttributeType type) { return(BeginAttribute(type, EmptyArray <object> .Instance)); }
public AttributeGen <ParameterGen> BeginAttribute(AttributeType type, params object[] args) { return(AttributeGen <ParameterGen> .CreateAndAdd(this, ref customAttributes, position == 0?AttributeTargets.ReturnValue : AttributeTargets.Parameter, type, args)); }
public AttributeGen<AssemblyGen> BeginAttribute(AttributeType type, params object[] args) { return AttributeGen<AssemblyGen>.CreateAndAdd(this, ref _assemblyAttributes, AttributeTargets.Assembly, type, args, TypeMapper); }
public EventGen Attribute(AttributeType type) { BeginAttribute(type); return(this); }
public AttributeGen<PropertyGen> BeginAttribute(AttributeType type, params object[] args) { return AttributeGen<PropertyGen>.CreateAndAdd(this, ref customAttributes, AttributeTargets.Property, type, args); }
public AttributeGen <EventGen> BeginAttribute(AttributeType type, params object[] args) { return(AttributeGen <EventGen> .CreateAndAdd(this, ref _customAttributes, AttributeTargets.Event, type, args, _owner.TypeMapper)); }
public AssemblyGen ModuleAttribute(AttributeType type, params object[] args) { BeginModuleAttribute(type, args); return this; }
public override T Attribute(AttributeType type) { BeginAttribute(type); return(TypedThis); }
public AttributeGen<AssemblyGen> BeginModuleAttribute(AttributeType type, params object[] args) { return AttributeGen<AssemblyGen>.CreateAndAdd(this, ref moduleAttributes, AttributeTargets.Module, type, args); }
public override T Attribute(AttributeType type, params object[] args) { BeginAttribute(type, args); return(TypedThis); }
public FieldGen Attribute(AttributeType type, params object[] args) { BeginAttribute(type, args); return this; }
public override AttributeGen <T> BeginAttribute(AttributeType type) { return(BeginAttribute(type, EmptyArray <object> .Instance)); }
public AttributeGen<FieldGen> BeginAttribute(AttributeType type, params object[] args) { return AttributeGen<FieldGen>.CreateAndAdd(this, ref _customAttributes, AttributeTargets.Field, type, args, _owner.TypeMapper); }
public override AttributeGen <T> BeginAttribute(AttributeType type, params object[] args) { return(AttributeGen <T> .CreateAndAdd(TypedThis, ref _customAttributes, AttributeTarget, type, args, TypeMapper)); }
public DelegateGen Attribute(AttributeType type) { BeginAttribute(type); return(this); }
public AssemblyGen ModuleAttribute(AttributeType type) { BeginModuleAttribute(type); return(this); }