Beispiel #1
0
        public IEnumerable <ProcessedMemberBase> WithSameSelector(ProcessedMemberBase member)
        {
            var typeRegistration = GetRegistrationForType(member.DeclaringType);

            if (typeRegistration != null)
            {
                foreach (var selector in member.Selectors)
                {
                    ProcessedMemberBase registeredMember = null;
                    if (typeRegistration.TryGetValue(selector, out registeredMember))
                    {
                        yield return(registeredMember);
                    }
                }
            }
        }
Beispiel #2
0
        public void Register(ProcessedMemberBase member)
        {
            Logger.Log($"TypeMapper Register: {member} {String.Join (" ", member.Selectors)}");

            var typeRegistration = GetRegistrationForType(member.DeclaringType);

            if (typeRegistration == null)
            {
                typeRegistration = new Dictionary <string, ProcessedMemberBase> ();
                MappedTypes.Add(member.DeclaringType, typeRegistration);
            }
            foreach (var selector in member.Selectors)
            {
                typeRegistration.Add(selector, member);
            }
        }
Beispiel #3
0
 public DuplicationStatus CheckForDuplicateSelectors(ProcessedMemberBase member)
 {
     if (IsSelectorTaken(member))
     {
         foreach (var conflictMethod in WithSameSelector(member))
         {
             conflictMethod.FallBackToTypeName = true;
         }
         member.FallBackToTypeName = true;
     }
     // Check to see if FallBackToTypeName is insufficient and scream
     if (IsSelectorTaken(member))
     {
         return(DuplicationStatus.Unresolvable);
     }
     return(DuplicationStatus.None);
 }
Beispiel #4
0
        public bool IsSelectorTaken(ProcessedMemberBase member)
        {
            var typeRegistration = GetRegistrationForType(member.DeclaringType);

            if (typeRegistration != null)
            {
                foreach (var selector in member.Selectors)
                {
                    if (typeRegistration.ContainsKey(selector))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }