Exemplo n.º 1
0
        public void GetConstructor()
        {
            var constructor = DefaultConstructorAttribute.GetConstructor(
                typeof(ComplexRule));

            Assert.IsNotNull(constructor);
        }
        public void GetConstructor()
        {
            var constructor = DefaultConstructorAttribute.GetConstructor(
                typeof(ComplexRule));

            constructor.ShouldNotBeNull();
        }
        /// <summary>
        /// Returns the System.Reflection.ConstructorInfo for the PluggedType.  Uses either
        /// the "greediest" constructor with the most arguments or the constructor function
        /// marked with the [DefaultConstructor]
        /// </summary>
        /// <returns></returns>
        public static ConstructorInfo GetConstructor(Type pluggedType)
        {
            ConstructorInfo returnValue = DefaultConstructorAttribute.GetConstructor(pluggedType);

            // if no constructor is marked as the "ContainerConstructor", find the greediest constructor
            if (returnValue == null)
            {
                returnValue = GetGreediestConstructor(pluggedType);
            }

            return(returnValue);
        }
Exemplo n.º 4
0
 public ConstructorInfo Find(Type pluggedType, DependencyCollection dependencies, PluginGraph graph)
 {
     return(DefaultConstructorAttribute.GetConstructor(pluggedType));
 }
 public ConstructorInfo Find(Type pluggedType)
 {
     return(DefaultConstructorAttribute.GetConstructor(pluggedType));
 }