当前位置: 首页>>代码示例>>C#>>正文


C# ConstructorBuilder.SetCustomAttribute方法代码示例

本文整理汇总了C#中System.Reflection.Emit.ConstructorBuilder.SetCustomAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# ConstructorBuilder.SetCustomAttribute方法的具体用法?C# ConstructorBuilder.SetCustomAttribute怎么用?C# ConstructorBuilder.SetCustomAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Reflection.Emit.ConstructorBuilder的用法示例。


在下文中一共展示了ConstructorBuilder.SetCustomAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConstructorBuilderHelper

		/// <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);
		}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:14,代码来源:ConstructorBuilderHelper.cs

示例2: EmitAttribute

		public void EmitAttribute (ConstructorBuilder builder)
		{
			if (ResolveBuilder ())
				builder.SetCustomAttribute (cab);
		}
开发者ID:alisci01,项目名称:mono,代码行数:5,代码来源:attribute.cs

示例3: AddDebuggerHiddenAttribute

 /// <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);
 }
开发者ID:yallie,项目名称:zyan,代码行数:10,代码来源:AnonymousMetaType.cs

示例4: EmitCustomAttributes

 private void EmitCustomAttributes(ConstructorBuilder ctorBuilder, IEnumerable<Cci.ICustomAttribute> attributes)
 {
     foreach (var attribute in attributes)
     {
         ctorBuilder.SetCustomAttribute(CreateCustomAttributeBuilder(attribute));
     }
 }
开发者ID:furesoft,项目名称:roslyn,代码行数:7,代码来源:ReflectionEmitter.cs

示例5: SetCustomAttributes

 public static void SetCustomAttributes(ConstructorBuilder cb, IPersistentMap attributes)
 {
     foreach (CustomAttributeBuilder cab in CreateCustomAttributeBuilders(attributes))
         cb.SetCustomAttribute(cab);
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:5,代码来源:GenInterface.cs

示例6: AddDebuggerHiddenAttribute

 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);
 }
开发者ID:devIceMan,项目名称:LambdaBuilder,代码行数:6,代码来源:AnonymousTypeBuilder.cs

示例7: DefineCustomAttributes

 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);
             }
         }
     }
 }
开发者ID:40a,项目名称:PowerShell,代码行数:14,代码来源:PSType.cs


注:本文中的System.Reflection.Emit.ConstructorBuilder.SetCustomAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。