SetCustomAttribute() 공개 메소드

public SetCustomAttribute ( System customBuilder ) : void
customBuilder System
리턴 void
		/// <summary>
		/// Initializes a new instance of the <see cref="ConstructorBuilder"/> class
		/// with the specified parameters.
		/// </summary>
		/// <param name="typeBuilder">Associated <see cref="TypeBuilderHelper"/>.</param>
		/// <param name="constructorBuilder">A <see cref="ConstructorBuilder"/></param>
		public ConstructorBuilderHelper(TypeBuilderHelper typeBuilder, ConstructorBuilder constructorBuilder)
			: base(typeBuilder)
		{
			if (constructorBuilder == null) throw new ArgumentNullException("constructorBuilder");

			_constructorBuilder = constructorBuilder;
			_constructorBuilder.SetCustomAttribute(Type.Assembly.BLToolkitAttribute);
		}
예제 #2
0
파일: attribute.cs 프로젝트: alisci01/mono
		public void EmitAttribute (ConstructorBuilder builder)
		{
			if (ResolveBuilder ())
				builder.SetCustomAttribute (cab);
		}
예제 #3
0
 /// <summary>
 /// Adds a <see cref="DebuggerHiddenAttribute"/> to a constructor.
 /// </summary>
 /// <param name="constructor">The constructor to add the attribute.</param>
 private static void AddDebuggerHiddenAttribute(ConstructorBuilder constructor)
 {
     Type attributeType = typeof(DebuggerHiddenAttribute);
     CustomAttributeBuilder attribute = new CustomAttributeBuilder(attributeType.GetConstructor(new Type[0]), new object[0]);
     constructor.SetCustomAttribute(attribute);
 }
예제 #4
0
 private void EmitCustomAttributes(ConstructorBuilder ctorBuilder, IEnumerable<Cci.ICustomAttribute> attributes)
 {
     foreach (var attribute in attributes)
     {
         ctorBuilder.SetCustomAttribute(CreateCustomAttributeBuilder(attribute));
     }
 }
예제 #5
0
 public static void SetCustomAttributes(ConstructorBuilder cb, IPersistentMap attributes)
 {
     foreach (CustomAttributeBuilder cab in CreateCustomAttributeBuilders(attributes))
         cb.SetCustomAttribute(cab);
 }
 private static void AddDebuggerHiddenAttribute(ConstructorBuilder constructor)
 {
     var type = typeof(DebuggerHiddenAttribute);
     var customBuilder = new CustomAttributeBuilder(type.GetConstructor(new Type[0]), new object[0]);
     constructor.SetCustomAttribute(customBuilder);
 }
예제 #7
0
파일: PSType.cs 프로젝트: 40a/PowerShell
 internal static void DefineCustomAttributes(ConstructorBuilder member, ReadOnlyCollection<AttributeAst> attributes, Parser parser, AttributeTargets attributeTargets)
 {
     if (attributes != null)
     {
         foreach (var attr in attributes)
         {
             var cabuilder = GetAttributeBuilder(parser, attr, attributeTargets);
             if (cabuilder != null)
             {
                 member.SetCustomAttribute(cabuilder);
             }
         }
     }
 }