Exemplo n.º 1
0
 /// <summary>
 /// Set the set of aliases to use for resolution.
 /// </summary>
 /// <param name="section">Configuration section containing the various
 /// type aliases, namespaces and assemblies.</param>
 public static void SetAliases(UnityConfigurationSection section)
 {
     impl = new TypeResolverImpl(
         section.TypeAliases.Select(e => new KeyValuePair <string, string>(e.Alias, e.TypeName)),
         section.Namespaces.Select(e => e.Name),
         section.Assemblies.Select(e => e.Name));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Set the set of aliases to use for resolution.
 /// </summary>
 /// <param name="section">Configuration section containing the various
 /// type aliases, namespaces and assemblies.</param>
 public static void SetAliases(UnityConfigurationSection section)
 {
     impl = new TypeResolverImpl(
         section.TypeAliases.Select(e => new KeyValuePair<string, string>(e.Alias, e.TypeName)),
         section.Namespaces.Select(e => e.Name),
         section.Assemblies.Select(e => e.Name));
 }
Exemplo n.º 3
0
        public static void SetAliases(UnityConfigurationSection section)
        {
            Microsoft.Practices.Unity.Utility.Guard.ArgumentNotNull(section, "section");

            impl = new TypeResolverImpl(
                section.TypeAliases.Select(e => new KeyValuePair<string, string>(e.Alias, e.TypeName)),
                section.Namespaces.Select(e => e.Name),
                section.Assemblies.Select(e => e.Name));
        }
Exemplo n.º 4
0
        public static void SetAliases(UnityConfigurationSection section)
        {
            Microsoft.Practices.Unity.Utility.Guard.ArgumentNotNull(section, "section");

            impl = new TypeResolverImpl(
                section.TypeAliases.Select(e => new KeyValuePair <string, string>(e.Alias, e.TypeName)),
                section.Namespaces.Select(e => e.Name),
                section.Assemblies.Select(e => e.Name));
        }
Exemplo n.º 5
0
        public void Setup()
        {
            var aliases = new Dictionary<string, string>
                {
                    { "dict", typeof(Dictionary<,>).AssemblyQualifiedName },
                    { "ILogger", "Microsoft.Practices.Unity.TestSupport.ILogger, Unity.TestSupport" },
                    { "MockLogger", "Microsoft.Practices.Unity.TestSupport.MockLogger, Unity.TestSupport" }
                };

            var namespaces = new[] { "System", "System.Collections.Generic", "Microsoft.Practices.Unity.TestSupport" };
            var assemblies = new[] { "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "Unity.TestSupport" };

            typeResolver = new TypeResolverImpl(aliases, namespaces, assemblies);
        }