コード例 #1
0
 private static CustomAttributeMetadata InstantiateCustomAttributeWithType(
     CustomAttributeMetadata customAttributeTemplate,
     TypeMetadata typeMetadata)
 {
     return(new CustomAttributeMetadata(
                customAttributeTemplate.AttributeType,
                customAttributeTemplate.NamedArguments,
                customAttributeTemplate.PositionalArguments));
 }
コード例 #2
0
ファイル: LoadedTypes.cs プロジェクト: rjmholt/ModuleAnalyzer
        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());
        }