示例#1
0
        public AttributeGen <TypeGen> BeginAttribute(AttributeType type, params object[] args)
        {
            AttributeTargets target = AttributeTargets.Class;

            if (baseType == null)
            {
                target = AttributeTargets.Interface;
            }
            else if (baseType == typeof(ValueType))
            {
                target = AttributeTargets.Struct;
            }
            else
            {
                target = AttributeTargets.Class;
            }

            return(AttributeGen <TypeGen> .CreateAndAdd(this, ref customAttributes, target, type, args));
        }
示例#2
0
        public override AttributeGen <TypeGen> BeginAttribute(AttributeType type, params object[] args)
        {
            AttributeTargets target = AttributeTargets.Class;

            if (BaseType == null)
            {
                target = AttributeTargets.Interface;
            }
            else if (BaseType == TypeMapper.MapType(typeof(ValueType)))
            {
                target = AttributeTargets.Struct;
            }
            else
            {
                target = AttributeTargets.Class;
            }

            return(AttributeGen <TypeGen> .CreateAndAdd(this, ref _customAttributes, target, type, args, TypeMapper));
        }
示例#3
0
 public AttributeGen <AssemblyGen> BeginModuleAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <AssemblyGen> .CreateAndAdd(this, ref _moduleAttributes, AttributeTargets.Module, type, args, TypeMapper));
 }
示例#4
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 <ParameterGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <ParameterGen> .CreateAndAdd(this, ref CustomAttributes, Position == 0?AttributeTargets.ReturnValue : AttributeTargets.Parameter, type, args, TypeMapper));
 }
示例#6
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));
 }
示例#7
0
 public AttributeGen <PropertyGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <PropertyGen> .CreateAndAdd(this, ref customAttributes, AttributeTargets.Property, type, args));
 }
示例#8
0
 public override AttributeGen <T> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <T> .CreateAndAdd(TypedThis, ref _customAttributes, AttributeTarget, type, args, TypeMapper));
 }
示例#9
0
 public AttributeGen <T> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <T> .CreateAndAdd(typedThis, ref customAttributes, AttributeTarget, type, args));
 }
示例#10
0
 public AttributeGen <AssemblyGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <AssemblyGen> .CreateAndAdd(this, ref assemblyAttributes, AttributeTargets.Assembly, type, args));
 }
示例#11
0
 public override AttributeGen <DelegateGen> BeginAttribute(AttributeType type, params object[] args)
 {
     return(AttributeGen <DelegateGen> .CreateAndAdd(this, ref _customAttributes, AttributeTargets.Delegate, type, args, TypeMapper));
 }