示例#1
0
 /// <summary>
 /// Registers any classes in assemblies indicated by the AssemblyFilter that
 /// - Is in an allowed namespace
 /// - Implements an interface the is also in an allowed namespace
 /// - Does not implement IWindsorInstaller
 /// - Is not marked with the DoNotInstallByConvention attribute
 /// - Contains the unprefixed name of the interface in its own name (DefaultInterfaces)
 /// </summary>
 /// <param name="container">An IWindsorContainer implementation</param>
 /// <param name="store">An IConfigurationStore implementation</param>
 public void Install(IWindsorContainer container, IConfigurationStore store)
 {
     container.Register(
         Classes
         .FromAssemblyInDirectory(AssemblyFilters.GetFilter())
         .Where(t => ContainerReporter.AddType(t) &&
                IsInAllowedNameNamespace(t) &&
                t.GetInterfaces().Any(i => IsInAllowedNameNamespace(i)) &&
                !t.GetInterfaces().Contains(typeof(IWindsorInstaller)) &&
                !t.GetCustomAttributes(false).Where(a => a.GetType() == typeof(DoNotInstallByConventionAttribute)).Any())
         .WithServiceDefaultInterfaces()
         .Configure(c => c.Named(c.Implementation.Name)));
 }
        public static void DumpConfiguration()
        {
            ContainerReporter.AddDiagnosticMessage("Simple Configuration Properties");
            ContainerReporter.AddDiagnosticMessage(string.Format("CastleWindsorConfigurationFolderName={0}", CastleWindsorConfigurationFolderName));
            ContainerReporter.AddDiagnosticMessage(string.Format("CastleWindsorConfigurationFilePattern={0}", CastleWindsorConfigurationFilePattern));
            ContainerReporter.AddDiagnosticMessage(string.Format("CastleWindsorDumpFileName={0}", CastleWindsorDumpFileName));
            ContainerReporter.AddDiagnosticMessage(string.Format("InstallerAssemblyFilterMask={0}", InstallerAssemblyFilterMask));

            foreach (string n in ConventionBasedInstallerNamespacePrefixes)
            {
                ContainerReporter.AddDiagnosticMessage(string.Format("ConventionBasedInstallerNamespacePrefixes[]={0}", n));
            }
        }
示例#3
0
        /// <summary>
        /// Writes the values of all the derived settings for inclusion in the log
        /// </summary>
        internal static void DumpConfiguration()
        {
            ContainerReporter.AddDiagnosticMessage("Derived Configuration Properties");
            ContainerReporter.AddDiagnosticMessage(string.Format("XmlConfigDirectory={0}", XmlConfigDirectory));
            ContainerReporter.AddDiagnosticMessage(string.Format("XmlConfigPattern={0}", XmlConfigPattern));
            ContainerReporter.AddDiagnosticMessage(string.Format("AssemblyDirectory={0}", AssemblyDirectory));
            ContainerReporter.AddDiagnosticMessage(string.Format("AssemblyFilterMask={0}", AssemblyFilterMask));
            ContainerReporter.AddDiagnosticMessage(string.Format("DumpFilePath={0}", DumpFilePath));

            foreach (string n in NamespacePrefixes)
            {
                ContainerReporter.AddDiagnosticMessage(string.Format("NamespacePrefixes[]={0}", n));
            }
        }