예제 #1
0
        private Dictionary <Type, List <Type> > GetAllAttributes()
        {
            var allAttributes = new Dictionary <Type, List <Type> >();

            foreach (var involvedType in _involvedTypes)
            {
                foreach (var attribute in CustomAttributeData.GetCustomAttributes(involvedType.Type))
                {
                    //var attributeType = attribute.GetType();
                    var attributeType = attribute.Constructor.DeclaringType;

                    if (_remotionReflector.IsInfrastructureType(attributeType))
                    {
                        continue;
                    }

                    if (!allAttributes.ContainsKey(attributeType))
                    {
                        allAttributes.Add(attributeType, new List <Type>());
                    }

                    var values = allAttributes[attributeType];
                    if (!values.Contains(involvedType.Type))
                    {
                        values.Add(involvedType.Type);
                    }
                }
            }
            return(allAttributes);
        }
 public XElement GenerateXml()
 {
     return(new XElement(
                "AttributeIntroductions",
                from introducedAttribute in _attributeIntroductionDefinitions
                where !_remotionReflector.IsInfrastructureType(introducedAttribute.GetProperty("AttributeType").To <Type>())
                select GenerateAttributeReferanceElement(introducedAttribute.GetProperty("AttributeType").To <Type>())));
 }
 public XElement GenerateXml()
 {
     return(new XElement(
                "HasAttributes",
                from attribute in CustomAttributeData.GetCustomAttributes(_type)
                where !_remotionReflector.IsInfrastructureType(attribute.Constructor.DeclaringType)
                select GenerateAttributeReference(attribute)
                ));
 }
 public XElement GenerateXml()
 {
     return(new XElement(
                "ImplementedInterfaces",
                from implementedInterface in GetAllInterfaces()
                where !_remotionReflector.IsInfrastructureType(implementedInterface)
                select GenerateInterfaceReference(implementedInterface)
                ));
 }