Exemple #1
0
        public override Type GetSystemType(TyonHydraterBase hydrater)
        {
            IEnumerable <Filterer <Type> > filters = new Filterer <Type>[] {
                Filterer_Type.IsNamed(GetName()),
                Filterer_Type.IsNonNestedClass(),
                Filterer_Type.IsNonGenericClass()
            };

            return(Types.GetFilteredTypes(
                       filters.AppendIf(
                           HasNamespace(),
                           Filterer_Type.IsNamespace(GetNamespace())
                           )
                       ).GetFirst()
                   .ChainIfNull(t => hydrater.LogMissingType(GetId())));
        }
Exemple #2
0
        public override Type GetSystemType(TyonHydraterBase hydrater)
        {
            Type[] generic_arguments = GetTyonTypes()
                                       .Convert(t => t.GetSystemType(hydrater))
                                       .ToArray();

            IEnumerable <Filterer <Type> > filters = new Filterer <Type>[] {
                Filterer_Type.IsBasicNamed(GetName()),
                Filterer_Type.IsGenericClass(),
                Filterer_Type.IsNonNestedClass(),
                Filterer_Type.CanGenericParametersHold(generic_arguments)
            };

            Type generic_type = Types.GetFilteredTypes(
                filters.AppendIf(
                    HasNamespace(),
                    Filterer_Type.IsNamespace(GetNamespace())
                    )
                ).GetFirst()
                                .ChainIfNull(t => hydrater.LogMissingType(GetId()));

            return(generic_type.MakeGenericType(generic_arguments));
        }