Exemplo n.º 1
0
 private static bool ProcessIgnores(TypeAdapterSettings config, IMemberModel destinationMember)
 {
     if (config.IgnoreMembers.Contains(destinationMember.Name))
         return true;
     var attributes = destinationMember.GetCustomAttributes(true).Select(attr => attr.GetType());
     return config.IgnoreAttributes.Overlaps(attributes);
 }
Exemplo n.º 2
0
        private static bool ProcessIgnores(TypeAdapterSettings config, IMemberModel destinationMember)
        {
            if (config.IgnoreMembers.Contains(destinationMember.Name))
            {
                return(true);
            }
            var attributes = destinationMember.GetCustomAttributes(true).Select(attr => attr.GetType());

            return(config.IgnoreAttributes.Overlaps(attributes));
        }
Exemplo n.º 3
0
        private static bool ProcessIgnores(
            TypeAdapterSettings config,
            IMemberModel destinationMember,
            Expression source,
            out LambdaExpression condition)
        {
            if (config.IgnoreMembers.TryGetValue(destinationMember.Name, out condition))
            {
                return(condition == null);
            }

            var attributes = destinationMember.GetCustomAttributes(true).Select(attr => attr.GetType());

            return(config.IgnoreAttributes.Overlaps(attributes));
        }
Exemplo n.º 4
0
 public static T GetCustomAttribute <T>(this IMemberModel member)
 {
     return((T)member.GetCustomAttributes(true).FirstOrDefault(attr => attr is T));
 }
Exemplo n.º 5
0
 public static bool HasCustomAttribute(this IMemberModel member, Type type)
 {
     return(member.GetCustomAttributes(true).Any(attr => attr.GetType() == type));
 }