HasConstructors() public static method

public static HasConstructors ( Type pluggedType ) : bool
pluggedType System.Type
return bool
示例#1
0
 public void Process(Type type, Registry registry)
 {
     if (type.CanBeCastTo(_pluginType) && Constructor.HasConstructors(type))
     {
         string name = _getName(type);
         registry.AddType(GetLeastSpecificButValidType(_pluginType, type), type, name);
     }
 }
示例#2
0
        private void assertPluggability(Type pluggedType)
        {
            if (!pluggedType.CanBeCastTo(_pluginType))
            {
                throw new StructureMapException(104, pluggedType, _pluginType);
            }

            if (!Constructor.HasConstructors(pluggedType))
            {
                throw new StructureMapException(180, pluggedType.AssemblyQualifiedName);
            }
        }
示例#3
0
        public override void Process(Type type, Registry registry)
        {
            if (!type.IsConcrete())
            {
                return;
            }

            Type pluginType = FindPluginType(type);

            if (pluginType != null && Constructor.HasConstructors(type))
            {
                registry.AddType(pluginType, type);
                ConfigureFamily(registry.For(pluginType));
            }
        }
示例#4
0
 public bool CanBeCreated()
 {
     return(Constructor.HasConstructors(_pluggedType));
 }