Ejemplo n.º 1
0
        /// <summary>
        /// Creates and returns the attributes builder for the component with the specified type name.
        /// </summary>
        /// <param name="typeName">Name of the type.</param>
        /// <returns>An instance of <see cref="ComponentAttributesAtataContextBuilder"/>.</returns>
        public ComponentAttributesAtataContextBuilder Component(string typeName)
        {
            string assemblyNamePattern = BuildingContext.AssemblyNamePatternToFindComponentTypes
                                         ?? BuildingContext.DefaultAssemblyNamePatternToFindTypes;

            Assembly[] assemblies = AssemblyFinder.FindAllByPatterns(AtataAssembliesNamePattern, assemblyNamePattern);
            Type       type       = TypeFinder.FindInAssemblies(typeName, assemblies);

            return(Component(type));
        }
Ejemplo n.º 2
0
 private Type ConvertToType(object value)
 {
     if (value is Type valueAsType)
     {
         return(valueAsType);
     }
     else if (value is string typeName)
     {
         Assembly[] assemblies = AssemblyFinder.FindAllByPattern(AssemblyNamePatternToFindTypes);
         return(TypeFinder.FindInAssemblies(typeName, assemblies));
     }
     else
     {
         throw ConversionException.For(value, typeof(Type));
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates and returns the attributes builder for the assembly with the specified name.
        /// </summary>
        /// <param name="assemblyName">Name of the assembly.</param>
        /// <returns>An instance of <see cref="AssemblyAttributesAtataContextBuilder"/>.</returns>
        public AssemblyAttributesAtataContextBuilder Assembly(string assemblyName)
        {
            var assembly = AssemblyFinder.Find(assemblyName);

            return(Assembly(assembly));
        }