Exemple #1
0
        public IQualifiedMember WithType(Type runtimeType)
        {
            if (runtimeType == Type)
            {
                return(this);
            }

            var childMembers = new Member[_childMembers.Length];

            Array.Copy(_childMembers, 0, childMembers, 0, childMembers.Length - 1);
            childMembers[childMembers.Length - 1] = _childMembers.Last().WithType(runtimeType);

            var dictionaryEntry = new DictionaryEntrySourceMember(
                runtimeType,
                _pathFactory,
                _matchedTargetMember,
                Parent,
                childMembers);

            if (runtimeType.IsDictionary())
            {
                return(new DictionarySourceMember(dictionaryEntry, _matchedTargetMember));
            }

            return(dictionaryEntry);
        }
Exemple #2
0
 public DictionaryEntrySourceMember(DictionaryEntrySourceMember parent, Member childMember)
     : this(
         childMember.Type,
         () => parent.GetPath() + "." + childMember.Name,
         parent._matchedTargetMember.Append(childMember),
         parent.Parent,
         parent._childMembers.Append(childMember))
 {
 }