예제 #1
0
			public IWriter Get(TypeInfo parameter)
			{
				var typeInfo = _locator.Get(parameter);
				var element  = _identities.Get(typeInfo);
				var identity = _store.Get($"ArrayOf{element.Name}", element.Identifier ?? string.Empty);
				return new ArrayIdentity(identity).Adapt();
			}
예제 #2
0
			TypeInfo GetTypeInfo(IIdentity parameter)
			{
				var identity = _store.Get(parameter.Name.Replace("ArrayOf", string.Empty),
				                          parameter.Identifier);
				var typeInfo = _types.Get(identity);
				var result = typeInfo?.MakeArrayType()
				                     .GetTypeInfo();
				return result;
			}
        public TypeParts Get(TypeParts parameter)
        {
            var arguments = parameter.GetArguments();
            var identity  = _store.Get(parameter.Name, parameter.Identifier);
            var result    = new TypeParts(identity.Name, identity.Identifier,
                                          arguments.HasValue
                                                           ? arguments.Value.Select(_selector).ToImmutableArray
                                                           : (Func <ImmutableArray <TypeParts> >)null);

            return(result);
        }
예제 #4
0
 public IEnumerable <KeyValuePair <TypeInfo, IIdentity> > Get(IEnumerable <TypeInfo> parameter)
 {
     foreach (var type in parameter.SelectMany(_types).Distinct())
     {
         var key = _identity.Get(type);
         if (key != null)
         {
             var identifier = key.Value.Identifier.NullIfEmpty() ?? _formatter.Get(type);
             var name       = key.Value.Name.NullIfEmpty() ?? type.Name;
             var identity   = _store.Get(name, identifier);
             yield return(Pairs.Create(type, identity));
         }
     }
 }
        protected override TypeInfo Create(TypeParts parameter)
        {
            var identity  = _identities.Get(parameter.Name, parameter.Identifier);
            var typeInfo  = _types.Get(identity);
            var arguments = parameter.GetArguments();
            var type      = arguments.HasValue
                                ? typeInfo.MakeGenericType(Arguments(arguments.Value))
                            .GetTypeInfo()
                                : typeInfo;

            if (type == null)
            {
                throw new ParseException(
                          $"An attempt was made to parse the identity '{IdentityFormatter.Default.Get(identity)}', but no type could be located with that name.");
            }

            var result = parameter.Dimensions.HasValue ? new DimensionsAlteration(parameter.Dimensions.Value).Get(type) : type;

            return(result);
        }
 public TypeInfo Get(IFormatReader parameter)
 => FromAttributes(parameter) ?? _types.Get(_identities.Get(parameter.Name, parameter.Identifier));
예제 #7
0
 protected override IIdentity Create(TypeInfo parameter)
 => _source.Get(_alias.Get(parameter) ?? _formatter.Get(parameter), _identifiers.Get(parameter));
예제 #8
0
 public TypeInfo Get(IFormatReader parameter)
 => FromAttributes(parameter) ??
 (!parameter.IsSatisfiedBy(MemberIdentity.Default)
                             ? _types.Get(_identities.Get(parameter.Name, parameter.Identifier))
                             : null);
예제 #9
0
 public IIdentity Get(string name, string identifier) => _store.Get(name, identifier);
예제 #10
0
 public IIdentity Get(string name, string identifier) => _store.Get(name, Prefix(identifier));
예제 #11
0
 bool IsMember(IMember profile)
 => CollectionItemTypeLocator.Default.Get(profile.MemberType)?.Name == profile.Name ||
 _types.Get(_identities.Get(profile.Name, _identifiers.Get(profile.Metadata.ReflectedType))) != null;
예제 #12
0
 public IIdentity Get(string name, string identifier) => _store.Get(name, _manager.LookupNamespace(identifier));
예제 #13
0
 public TypeInfo Get(IFormatReader parameter)
 => FromAttributes(parameter) ?? (parameter.Contains(MemberIdentity.Default)
                                                          ? null
                                                          : _types.Get(_identities.Get(parameter.Name, parameter.Identifier)));
예제 #14
0
 public Composer(IIdentityStore store) : this(store.Get("Name", string.Empty))
 {
 }