Exemplo n.º 1
0
        private PairedMembers DetectPair(IMember from, IMember to)
        {
            if (from.Symbol != to.Symbol || !from.CanPairWith(to))
            {
                return(null);
            }

            return(this.CreateMemberPair(from, to));
        }
Exemplo n.º 2
0
        public PairedMembers(IMember from, IMember to, IUnresolvedMapping mapping)
        {
            if (!from.CanPairWith(to))
            {
                throw new Exception($"Cannot map {from} and {to} together");
            }

            this.From = from;
            this.To   = to;

            this.Mapping = mapping;
        }
Exemplo n.º 3
0
        private PairedMembers DetectPairLeft(IMember from, IMember to, Symbol foundPart)
        {
            IMember foundMember = null;

            foreach (IMember toOne in this.GetToMembers(to.Type, to))
            {
                if (from.Symbol == foundPart + toOne.Symbol && from.CanPairWith(toOne))
                {
                    return(this.CreateMemberPair(from, toOne));
                }
                else if (from.Symbol.HasPrefix(toOne.Symbol))
                {
                    foundMember = toOne;
                }
            }

            if (foundMember != null)
            {
                return(this.DetectPairLeft(from, foundMember, foundPart + foundMember.Symbol));
            }

            return(null);
        }