示例#1
0
 private static CustomAttributeMetadata InstantiateCustomAttributeWithType(
     CustomAttributeMetadata customAttributeTemplate,
     TypeMetadata typeMetadata)
 {
     return(new CustomAttributeMetadata(
                customAttributeTemplate.AttributeType,
                customAttributeTemplate.NamedArguments,
                customAttributeTemplate.PositionalArguments));
 }
示例#2
0
        private static IImmutableList <CustomAttributeMetadata> GetCustomAttributes(IEnumerable <CustomAttributeData> customAttributeData)
        {
            var customAttributes = new List <CustomAttributeMetadata>();

            foreach (CustomAttributeData customAttribute in customAttributeData)
            {
                var customAttributeMetadata = new CustomAttributeMetadata(
                    FromType(customAttribute.AttributeType),
                    GetNamedArguments(customAttribute),
                    GetPositionalArguments(customAttribute)
                    );

                customAttributes.Add(customAttributeMetadata);
            }

            return(customAttributes.ToImmutableArray());
        }