Ejemplo n.º 1
0
 static ProviderKey()
 {
     ServerType = new ProviderKey { Name = "ServerType", Type = typeof(IAppServer) };
     SocketServerFactory = new ProviderKey { Name = "SocketServerFactory", Type = typeof(ISocketServerFactory) };
     ConnectionFilter = new ProviderKey { Name = "ConnectionFilter", Type = typeof(IConnectionFilter) };
     LogFactory = new ProviderKey { Name = "LogFactory", Type = typeof(ILogFactory) };
     RequestFilterFactory = new ProviderKey { Name = "RequestFilterFactory", Type = typeof(IRequestFilterFactory) };
     CommandLoader = new ProviderKey { Name = "CommandLoader", Type = typeof(ICommandLoader) };
 }
Ejemplo n.º 2
0
 static ProviderKey()
 {
     ServerType = new ProviderKey {
         Name = "ServerType", Type = typeof(IAppServer)
     };
     SocketServerFactory = new ProviderKey {
         Name = "SocketServerFactory", Type = typeof(ISocketServerFactory)
     };
     ConnectionFilter = new ProviderKey {
         Name = "ConnectionFilter", Type = typeof(IConnectionFilter)
     };
     LogFactory = new ProviderKey {
         Name = "LogFactory", Type = typeof(ILogFactory)
     };
     ReceiveFilterFactory = new ProviderKey {
         Name = "ReceiveFilterFactory", Type = typeof(IReceiveFilterFactory)
     };
 }
Ejemplo n.º 3
0
 static ProviderKey()
 {
     Service = new ProviderKey {
         Name = "Service", Type = typeof(IAppServer)
     };
     SocketServerFactory = new ProviderKey {
         Name = "SocketServerFactory", Type = typeof(ISocketServerFactory)
     };
     ConnectionFilter = new ProviderKey {
         Name = "ConnectionFilter", Type = typeof(IConnectionFilter)
     };
     LogFactory = new ProviderKey {
         Name = "LogFactory", Type = typeof(ILogFactory)
     };
     RequestFilterFactory = new ProviderKey {
         Name = "RequestFilterFactory", Type = typeof(IRequestFilterFactory)
     };
     CommandLoader = new ProviderKey {
         Name = "CommandLoader", Type = typeof(ICommandLoader)
     };
 }
        private List<ProviderFactoryInfo> InitializeProviderFactories(ProviderKey key, IEnumerable<ITypeProvider> providerCollection, ProviderFactoryInfo loadedFactory)
        {
            var loadedFactoryPassedIn = false;

            if(loadedFactory != null && !string.IsNullOrEmpty(loadedFactory.Name))
                loadedFactoryPassedIn = true;

            var factories = new List<ProviderFactoryInfo>();

            if (providerCollection == null || !providerCollection.Any())
            {
                return factories;
            }

            foreach (var provider in providerCollection)
            {
                if (loadedFactoryPassedIn)
                {
                    if (loadedFactory.Name.Equals(provider.Name, StringComparison.OrdinalIgnoreCase))
                    {
                        factories.Add(loadedFactory);
                        continue;
                    }
                }

                factories.Add(new ProviderFactoryInfo(key, provider.Name, ValidateProviderType(provider.Type)));
            }

            return factories;
        }
 private List<ProviderFactoryInfo> InitializeProviderFactories(ProviderKey key, IEnumerable<ITypeProvider> providerCollection)
 {
     return InitializeProviderFactories(key, providerCollection, null);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderFactoryInfo"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="name">The name.</param>
 /// <param name="type">The type.</param>
 public ProviderFactoryInfo(ProviderKey key, string name, Type type)
     : this(key, name, type.AssemblyQualifiedName)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderFactoryInfo"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="name">The name.</param>
 /// <param name="typeName">Name of the type.</param>
 public ProviderFactoryInfo(ProviderKey key, string name, string typeName)
 {
     Key           = key;
     Name          = name;
     ExportFactory = new ExportFactory(typeName);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderFactoryInfo"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="name">The name.</param>
 /// <param name="instance">The instance.</param>
 public ProviderFactoryInfo(ProviderKey key, string name, object instance)
 {
     Key           = key;
     Name          = name;
     ExportFactory = new ExportFactory(instance);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderFactoryInfo"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="name">The name.</param>
 /// <param name="type">The type.</param>
 public ProviderFactoryInfo(ProviderKey key, string name, Type type)
     : this(key, name, type.AssemblyQualifiedName)
 {
     
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderFactoryInfo"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="name">The name.</param>
 /// <param name="typeName">Name of the type.</param>
 public ProviderFactoryInfo(ProviderKey key, string name, string typeName)
 {
     Key = key;
     Name = name;
     ExportFactory = new ExportFactory(typeName);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderFactoryInfo"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="name">The name.</param>
 /// <param name="instance">The instance.</param>
 public ProviderFactoryInfo(ProviderKey key, string name, object instance)
 {
     Key = key;
     Name = name;
     ExportFactory = new ExportFactory(instance);
 }