Ejemplo n.º 1
0
 public ProviderInstaller(string providerType, Type providerInterface, Type defaultProvider)
 {
     _ComponentLifeStyle = ComponentLifeStyleType.Singleton;
     _ProviderType = providerType;
     _ProviderInterface = providerInterface;
     _defaultProvider = defaultProvider;
 }
Ejemplo n.º 2
0
 public ProviderInstaller(string providerType, Type providerInterface, Type defaultProvider)
 {
     _ComponentLifeStyle = ComponentLifeStyleType.Singleton;
     _ProviderType       = providerType;
     _ProviderInterface  = providerInterface;
     _defaultProvider    = defaultProvider;
 }
Ejemplo n.º 3
0
 public virtual void RegisterComponent(Type contractType, Type componentType, ComponentLifeStyleType lifestyle)
 {
     RegisterComponent(componentType.FullName, contractType, componentType, lifestyle);
 }
Ejemplo n.º 4
0
 public abstract void RegisterComponent(string name, Type contractType, Type componentType, ComponentLifeStyleType lifestyle);
Ejemplo n.º 5
0
 public virtual void RegisterComponent <TContract, TComponent>(string name, ComponentLifeStyleType lifestyle) where TComponent : class
 {
     RegisterComponent(name, typeof(TContract), typeof(TComponent), lifestyle);
 }
Ejemplo n.º 6
0
 public ProviderInstaller(string providerType, Type providerInterface, ComponentLifeStyleType lifeStyle)
 {
     _ComponentLifeStyle = lifeStyle;
     _ProviderType       = providerType;
     _ProviderInterface  = providerInterface;
 }
Ejemplo n.º 7
0
        public override void RegisterComponent(string name, Type contractType, Type type, ComponentLifeStyleType lifestyle)
        {
            AddComponentType(contractType);

            IComponentBuilder builder = null;

            switch (lifestyle)
            {
            case ComponentLifeStyleType.Transient:
                builder = new TransientComponentBuilder(name, type);
                break;

            case ComponentLifeStyleType.Singleton:
                builder = new SingletonComponentBuilder(name, type);
                break;
            }
            AddBuilder(contractType, builder);

            RegisterComponent(name, type);
        }
Ejemplo n.º 8
0
        public override void RegisterComponent(string name, Type contractType, Type type, ComponentLifeStyleType lifestyle)
        {
            AddComponentType(contractType);

            IComponentBuilder builder = null;
            switch (lifestyle)
            {
                case ComponentLifeStyleType.Transient:
                    builder = new TransientComponentBuilder(name, type);
                    break;
                case ComponentLifeStyleType.Singleton:
                    builder = new SingletonComponentBuilder(name, type);
                    break;
            }
            AddBuilder(contractType, builder);

            RegisterComponent(name, type);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderInstaller"/> class.
 /// </summary>
 /// <param name="providerType"></param>
 /// <param name="providerInterface"></param>
 public ProviderInstaller(string providerType, Type providerInterface)
 {
     this._ComponentLifeStyle = ComponentLifeStyleType.Singleton;
     this._ProviderType       = providerType;
     this._ProviderInterface  = providerInterface;
 }
Ejemplo n.º 10
0
 public ProviderInstaller(string providerType, Type providerInterface, ComponentLifeStyleType lifeStyle)
 {
     _ComponentLifeStyle = lifeStyle;
     _ProviderType = providerType;
     _ProviderInterface = providerInterface;
 }
Ejemplo n.º 11
0
        public override void RegisterComponent(string name, System.Type contractType, System.Type componentType, ComponentLifeStyleType lifestyle)
        {
            if (!componentTypes.Contains(contractType))
            {
                componentTypes.Add(new ComponentType(contractType));
            }
            IComponentBuilder builder = null;

            switch (lifestyle)
            {
            case ComponentLifeStyleType.Transient:
                builder = new TransientComponentBuilder(name, componentType);
                break;

            case ComponentLifeStyleType.Singleton:
                builder = new SingletonComponentBuilder(name, componentType);
                break;
            }
            AddBuilder(contractType, builder);
            registeredComponents[componentType] = name;
        }
 public ProviderInstaller(string providerType, Type providerInterface)
 {
     this._ComponentLifeStyle = ComponentLifeStyleType.Singleton;
     this._ProviderType = providerType;
     this._ProviderInterface = providerInterface;
 }
Ejemplo n.º 13
0
 public override void RegisterComponent(string name, System.Type contractType, System.Type componentType, ComponentLifeStyleType lifestyle)
 {
     if (!componentTypes.Contains(contractType))
     {
         componentTypes.Add(new ComponentType(contractType));
     }
     IComponentBuilder builder = null;
     switch (lifestyle)
     {
         case ComponentLifeStyleType.Transient:
             builder = new TransientComponentBuilder(name, componentType);
             break;
         case ComponentLifeStyleType.Singleton:
             builder = new SingletonComponentBuilder(name, componentType);
             break;
     }
     AddBuilder(contractType, builder);
     registeredComponents[componentType] = name;
 }