/// <summary>
 /// Initializes a new instance of the <see cref="AssemblyObjectDefinitionScanner"/> class.
 /// </summary>
 public AssemblyObjectDefinitionScanner()
 {
     AssemblyLoadExclusionPredicates.Add(delegate(string name) { return(_springAssemblies.Contains(name)); });
     AssemblyLoadExclusionPredicates.Add(delegate(string name) { return(name.StartsWith("System.")); });
     AssemblyLoadExclusionPredicates.Add(delegate(string name) { return(name.StartsWith("Microsoft.")); });
     AssemblyLoadExclusionPredicates.Add(delegate(string name) { return(name == "mscorlib"); });
     AssemblyLoadExclusionPredicates.Add(delegate(string name) { return(name == "System"); });
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AssemblyObjectDefinitionScanner"/> class.
 /// </summary>
 public AssemblyObjectDefinitionScanner()
 {
     AssemblyLoadExclusionPredicates.Add(candidate => _springAssemblyExcludePrefixes.Any(candidate.StartsWith) &&
                                         candidate != "Spring.Core.Tests");
     AssemblyLoadExclusionPredicates.Add(name => name.StartsWith("System."));
     AssemblyLoadExclusionPredicates.Add(name => name.StartsWith("Microsoft."));
     AssemblyLoadExclusionPredicates.Add(name => name == "mscorlib");
     AssemblyLoadExclusionPredicates.Add(name => name == "System");
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AssemblyObjectDefinitionScanner"/> class.
        /// </summary>
        /// <param name="assembliesToIncludePredicates">The assemblies to include predicates.</param>
        public AssemblyObjectDefinitionScanner(params Func <string, bool>[] assembliesToIncludePredicates)
        {
            //force exclude for ALL assemblies
            AssemblyLoadExclusionPredicates.Add(name => true);

            //since all assemblies are EXCLUDED above, these will be the ONLY assemblies to be loaded
            foreach (var predicate in assembliesToIncludePredicates)
            {
                AssemblyLoadInclusionPredicates.Add(predicate);
            }
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AssemblyObjectDefinitionScanner"/> class.
        /// </summary>
        public AssemblyObjectDefinitionScanner()
        {
            AssemblyLoadExclusionPredicates.Add(candidate =>
            {
                if ("Spring.Core.Tests".Equals(candidate, StringComparison.OrdinalIgnoreCase))
                {
                    return(false);
                }
                foreach (var prefix in _springAssemblyExcludePrefixes)
                {
                    if (candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
                    {
                        return(true);
                    }
                }

                return(false);
            });
            AssemblyLoadExclusionPredicates.Add(name => name.StartsWith("System."));
            AssemblyLoadExclusionPredicates.Add(name => name.StartsWith("Microsoft."));
            AssemblyLoadExclusionPredicates.Add(name => name == "mscorlib");
            AssemblyLoadExclusionPredicates.Add(name => name == "System");
        }