private GenericField[] Fields(GenericClass personClass, GenericReflector reflector
                               )
 {
     return(new GenericField[] { new GenericField("surname", reflector.ForClass(typeof(
                                                                                    string)), false), new GenericField("birthdate", reflector.ForClass(typeof(DateTime
                                                                                                                                                              )), false), new GenericField("bestFriend", personClass, false), new GenericField
                                     ("nArray", reflector.ForClass(typeof(int[][])), true) });
 }
Ejemplo n.º 2
0
 private void InitClassReflectors(GenericReflector reflector)
 {
     IclassCompare         = reflector.ForClass(Const4.ClassCompare);
     IclassDb4otype        = reflector.ForClass(Const4.ClassDb4otype);
     IclassDb4otypeimpl    = reflector.ForClass(Const4.ClassDb4otypeimpl);
     IclassInternal        = reflector.ForClass(Const4.ClassInternal);
     IclassUnversioned     = reflector.ForClass(Const4.ClassUnversioned);
     IclassObject          = reflector.ForClass(Const4.ClassObject);
     IclassObjectcontainer = reflector.ForClass(Const4.ClassObjectcontainer);
     IclassStaticclass     = reflector.ForClass(Const4.ClassStaticclass);
     IclassString          = reflector.ForClass(typeof(string));
     IclassTransientclass  = reflector.ForClass(Const4.ClassTransientclass);
     Platform4.RegisterCollections(reflector);
 }
Ejemplo n.º 3
0
        private bool IsTAAware(ClassMetadata classMetadata)
        {
            GenericReflector reflector = classMetadata.Reflector();

            return(reflector.ForClass(typeof(IActivatable)).IsAssignableFrom(classMetadata.ClassReflector
                                                                                 ()));
        }
        private void RegisterTypeHandler(IConfiguration config, Type clazz, ITypeHandler4
                                         typeHandler)
        {
            GenericReflector      reflector = ((Config4Impl)config).Reflector();
            IReflectClass         itemClass = reflector.ForClass(clazz);
            ITypeHandlerPredicate predicate = new _ITypeHandlerPredicate_229(itemClass);

            config.RegisterTypeHandler(predicate, typeHandler);
        }
        /// <summary>todo: Move the GenericClass creation into a utility/factory class.</summary>
        /// <remarks>todo: Move the GenericClass creation into a utility/factory class.</remarks>
        /// <returns></returns>
        public virtual GenericClass InitGenericClass()
        {
            GenericReflector reflector = new GenericReflector(null, Platform4.ReflectorForType
                                                                  (typeof(GenericObjectsTest)));
            GenericClass _objectIClass = (GenericClass)reflector.ForClass(typeof(object));
            GenericClass result        = new GenericClass(reflector, null, PersonClassname, _objectIClass
                                                          );

            result.InitFields(Fields(result, reflector));
            return(result);
        }