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);
		}
Example #2
0
	    public AttributeGen<FieldGen> BeginAttribute(AttributeType type)
		{
			return BeginAttribute(type, EmptyArray<object>.Instance);
		}
Example #3
0
        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;
		}
Example #6
0
 public PropertyGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return this;
 }
Example #7
0
 public AttributeGen <DelegateGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <DelegateGen> .CreateAndAdd(this, ref customAttributes, AttributeTargets.Delegate, type, args));
 }
Example #8
0
 public DelegateGen Attribute(AttributeType type, params object[] args)
 {
     BeginAttribute(type, args);
     return(this);
 }
Example #9
0
 public ParameterGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return(this);
 }
Example #10
0
 public abstract AttributeGen <T> BeginAttribute(AttributeType type, params object[] args);
Example #11
0
 public abstract AttributeGen <T> BeginAttribute(AttributeType type);
Example #12
0
 public abstract T Attribute(AttributeType type, params object[] args);
Example #13
0
 public abstract T Attribute(AttributeType type);
Example #14
0
 public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <AssemblyGen> .CreateAndAdd(this, ref _moduleAttributes, AttributeTargets.Module, type, args, TypeMapper));
 }
Example #15
0
 public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type)
 {
     return(BeginModuleAttribute(type, EmptyArray <object> .Instance));
 }
Example #16
0
	    public FieldGen Attribute(AttributeType type)
		{
			BeginAttribute(type);
			return this;
		}
Example #17
0
 public AssemblyGen ModuleAttribute(AttributeType type, params object[] args)
 {
     BeginModuleAttribute(type, args);
     return(this);
 }
Example #18
0
 public ParameterGen Attribute(AttributeType type, params object[] args)
 {
     BeginAttribute(type, args);
     return(this);
 }
Example #19
0
 public AttributeGen <DelegateGen> BeginAttribute(AttributeType type)
 {
     return(BeginAttribute(type, EmptyArray <object> .Instance));
 }
Example #20
0
 public AttributeGen <ParameterGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <ParameterGen> .CreateAndAdd(this, ref customAttributes, position == 0?AttributeTargets.ReturnValue : AttributeTargets.Parameter, type, args));
 }
Example #21
0
		public AttributeGen<AssemblyGen> BeginAttribute(AttributeType type, params object[] args)
		{
			return AttributeGen<AssemblyGen>.CreateAndAdd(this, ref _assemblyAttributes, AttributeTargets.Assembly, type, args, TypeMapper);
		}
Example #22
0
 public EventGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return(this);
 }
Example #23
0
 public AttributeGen<PropertyGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return AttributeGen<PropertyGen>.CreateAndAdd(this, ref customAttributes, AttributeTargets.Property, type, args);
 }
Example #24
0
 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);
 }
Example #29
0
	    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));
 }
Example #31
0
	    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));
 }
Example #33
0
 public DelegateGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return(this);
 }
Example #34
0
 public AssemblyGen ModuleAttribute(AttributeType type)
 {
     BeginModuleAttribute(type);
     return(this);
 }