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);
 }