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);
		}
示例#2
0
	    public AttributeGen<FieldGen> BeginAttribute(AttributeType type)
		{
			return BeginAttribute(type, EmptyArray<object>.Instance);
		}
示例#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;
		}
示例#6
0
 public PropertyGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return this;
 }
示例#7
0
 public AttributeGen <DelegateGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <DelegateGen> .CreateAndAdd(this, ref customAttributes, AttributeTargets.Delegate, type, args));
 }
示例#8
0
 public DelegateGen Attribute(AttributeType type, params object[] args)
 {
     BeginAttribute(type, args);
     return(this);
 }
示例#9
0
 public ParameterGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return(this);
 }
示例#10
0
 public abstract AttributeGen <T> BeginAttribute(AttributeType type, params object[] args);
示例#11
0
 public abstract AttributeGen <T> BeginAttribute(AttributeType type);
示例#12
0
 public abstract T Attribute(AttributeType type, params object[] args);
示例#13
0
 public abstract T Attribute(AttributeType type);
示例#14
0
 public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <AssemblyGen> .CreateAndAdd(this, ref _moduleAttributes, AttributeTargets.Module, type, args, TypeMapper));
 }
示例#15
0
 public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type)
 {
     return(BeginModuleAttribute(type, EmptyArray <object> .Instance));
 }
示例#16
0
	    public FieldGen Attribute(AttributeType type)
		{
			BeginAttribute(type);
			return this;
		}
示例#17
0
 public AssemblyGen ModuleAttribute(AttributeType type, params object[] args)
 {
     BeginModuleAttribute(type, args);
     return(this);
 }
示例#18
0
 public ParameterGen Attribute(AttributeType type, params object[] args)
 {
     BeginAttribute(type, args);
     return(this);
 }
示例#19
0
 public AttributeGen <DelegateGen> BeginAttribute(AttributeType type)
 {
     return(BeginAttribute(type, EmptyArray <object> .Instance));
 }
示例#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));
 }
示例#21
0
		public AttributeGen<AssemblyGen> BeginAttribute(AttributeType type, params object[] args)
		{
			return AttributeGen<AssemblyGen>.CreateAndAdd(this, ref _assemblyAttributes, AttributeTargets.Assembly, type, args, TypeMapper);
		}
示例#22
0
 public EventGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return(this);
 }
示例#23
0
 public AttributeGen<PropertyGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return AttributeGen<PropertyGen>.CreateAndAdd(this, ref customAttributes, AttributeTargets.Property, type, args);
 }
示例#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;
		}
示例#26
0
 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);
		}
示例#28
0
 public override T Attribute(AttributeType type, params object[] args)
 {
     BeginAttribute(type, args);
     return(TypedThis);
 }
示例#29
0
	    public FieldGen Attribute(AttributeType type, params object[] args)
		{
			BeginAttribute(type, args);
			return this;
		}
示例#30
0
 public override AttributeGen <T> BeginAttribute(AttributeType type)
 {
     return(BeginAttribute(type, EmptyArray <object> .Instance));
 }
示例#31
0
	    public AttributeGen<FieldGen> BeginAttribute(AttributeType type, params object[] args)
		{
			return AttributeGen<FieldGen>.CreateAndAdd(this, ref _customAttributes, AttributeTargets.Field, type, args, _owner.TypeMapper);
		}
示例#32
0
 public override AttributeGen <T> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <T> .CreateAndAdd(TypedThis, ref _customAttributes, AttributeTarget, type, args, TypeMapper));
 }
示例#33
0
 public DelegateGen Attribute(AttributeType type)
 {
     BeginAttribute(type);
     return(this);
 }
示例#34
0
 public AssemblyGen ModuleAttribute(AttributeType type)
 {
     BeginModuleAttribute(type);
     return(this);
 }