Exemplo n.º 1
0
 private void DefineCustomAttributes(ICustomAttributeTargetBuilder customAttributeTargetBuilder, IMutableInfo mutableInfo)
 {
     foreach (var declaration in mutableInfo.AddedCustomAttributes)
     {
         customAttributeTargetBuilder.SetCustomAttribute(declaration);
     }
 }
Exemplo n.º 2
0
        public void SetCustomAttribute(CustomAttributeDeclaration customAttributeDeclaration)
        {
            ArgumentUtility.CheckNotNull("customAttributeDeclaration", customAttributeDeclaration);

            var emittableConstructorArguments = customAttributeDeclaration.ConstructorArguments.Select(MakeAttributeArgumentEmittable).ToArray();
            var emittableNamedArguments       = customAttributeDeclaration.NamedArguments.Select(MakeEmittable).ToArray();
            var emittableDeclaration          = new CustomAttributeDeclaration(
                customAttributeDeclaration.Constructor, emittableConstructorArguments, emittableNamedArguments);

            _customAttributeTargetBuilder.SetCustomAttribute(emittableDeclaration);
        }