Ejemplo n.º 1
0
        private static ConstructorDefImpl CreateConstructorDef(bool injectable, ConstructorInfo constructor, bool isConstructorInjectable)
        {
            var parameters = constructor.GetParameters();

            IConstructorArg[] args = new ConstructorArgImpl[parameters.Length];

            for (int i = 0; i < parameters.Length; i++)
            {
                //TODO for getInterfaceTarget() call
                Type type     = parameters[i].ParameterType;
                bool isFuture = false;

                ParameterAttribute named = parameters[i].GetCustomAttribute <ParameterAttribute>();
                args[i] = new ConstructorArgImpl(type.FullName, named == null ? null : named.Value.AssemblyQualifiedName, isFuture);
            }
            return(new ConstructorDefImpl(constructor.DeclaringType.FullName, args, isConstructorInjectable));
        }
Ejemplo n.º 2
0
        public override bool Equals(Object o)
        {
            ConstructorArgImpl arg = (ConstructorArgImpl)o;

            if (!type.Equals(arg.type))
            {
                return(false);
            }
            if (name == null && arg.name == null)
            {
                return(true);
            }
            if (name == null && arg.name != null)
            {
                return(false);
            }
            if (name != null && arg.name == null)
            {
                return(false);
            }
            return(name.Equals(arg.name));
        }
Ejemplo n.º 3
0
        private static ConstructorDefImpl CreateConstructorDef(bool injectable, ConstructorInfo constructor, bool isConstructorInjectable)
        {
            var parameters = constructor.GetParameters();

            IConstructorArg[] args = new ConstructorArgImpl[parameters.Length];

            for (int i = 0; i < parameters.Length; i++)
            {
                //TODO for getInterfaceTarget() call
                Type type = parameters[i].ParameterType;
                bool isFuture = false;

                ParameterAttribute named = parameters[i].GetCustomAttribute<ParameterAttribute>();
                args[i] = new ConstructorArgImpl(type.FullName, named == null ? null : named.Value.AssemblyQualifiedName, isFuture);
            }
            return new ConstructorDefImpl(constructor.DeclaringType.FullName, args, isConstructorInjectable);
        }