public Maybe <ICreateObjects> PickConstructorWithLeastNonPointersParameters()
        {
            ICreateObjects leastParamsConstructor = null;

            var constructors   = For(_type).GetAllPublicConstructors();
            var numberOfParams = int.MaxValue;

            foreach (var typeConstructor in constructors)
            {
                if (
                    typeConstructor.HasNonPointerArgumentsOnly() &&
                    typeConstructor.HasLessParametersThan(numberOfParams))
                {
                    leastParamsConstructor = typeConstructor;
                    numberOfParams         = typeConstructor.GetParametersCount();
                }
            }

            return(leastParamsConstructor !.ToMaybe());
        }
Beispiel #2
0
 public ClassBuilderFactory(ICreateObjects objectFactory)
 {
     object_factory = objectFactory;
 }
Beispiel #3
0
 public ReflectionClassBuilder(ICreateObjects object_factory)
 {
     this.object_factory = object_factory;
 }