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(); }
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); }
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));
protected override IIdentity Create(TypeInfo parameter) => _source.Get(_alias.Get(parameter) ?? _formatter.Get(parameter), _identifiers.Get(parameter));
public TypeInfo Get(IFormatReader parameter) => FromAttributes(parameter) ?? (!parameter.IsSatisfiedBy(MemberIdentity.Default) ? _types.Get(_identities.Get(parameter.Name, parameter.Identifier)) : null);
public IIdentity Get(string name, string identifier) => _store.Get(name, identifier);
public IIdentity Get(string name, string identifier) => _store.Get(name, Prefix(identifier));
bool IsMember(IMember profile) => CollectionItemTypeLocator.Default.Get(profile.MemberType)?.Name == profile.Name || _types.Get(_identities.Get(profile.Name, _identifiers.Get(profile.Metadata.ReflectedType))) != null;
public IIdentity Get(string name, string identifier) => _store.Get(name, _manager.LookupNamespace(identifier));
public TypeInfo Get(IFormatReader parameter) => FromAttributes(parameter) ?? (parameter.Contains(MemberIdentity.Default) ? null : _types.Get(_identities.Get(parameter.Name, parameter.Identifier)));
public Composer(IIdentityStore store) : this(store.Get("Name", string.Empty)) { }