/// <summary>
 /// Set the current type adapter factory
 /// </summary>
 /// <param name="adapterFactory">The adapter factory to set</param>
 public static void SetCurrent(ITypeAdapterFactory adapterFactory)
 {
     lock (_thisObject)
     {
         _currentTypeAdapterFactory = adapterFactory;
     }
 }
 /// <summary>
 /// Set the current type adapter factory
 /// </summary>
 /// <param name="adapterFactory">The adapter factory to set</param>
 public static void SetCurrent(ITypeAdapterFactory adapterFactory)
 {
     lock (_thisObject)
     {
         _currentTypeAdapterFactory = adapterFactory;
     }
 }
Beispiel #3
0
 public PersonController(
     ITypeAdapterFactory adapterFactory,
     IPersonService personService
     )
 {
     _adapter       = adapterFactory.Create();
     _personService = personService;
 }
        public InventoryAppService(IInventoryRepository inventoryRepository, ITypeAdapterFactory typeAdapterFactory)
        {
            Contract.Requires <ArgumentNullException>(inventoryRepository != null, "inventoryRepository");
            Contract.Requires <ArgumentNullException>(typeAdapterFactory != null, "typeAdapterFactory");

            typeAdapterFactory.Initialize(typeof(InventoryProfile).Assembly);
            TypeAdapterFactory.SetCurrent(typeAdapterFactory);
            _inventoryRepository = inventoryRepository;
        }
        /// <summary>
        /// Create a new type adapter from currect factory
        /// </summary>
        /// <returns>Created type adapter</returns>
        public static ITypeAdapter CreateAdapter()
        {
            if (_currentTypeAdapterFactory == null)
                lock (lock_flag)
                {
                    if (_currentTypeAdapterFactory == null)
                        _currentTypeAdapterFactory = ObjectContainer.CreateInstance<ITypeAdapterFactory>();
                }

            return _currentTypeAdapterFactory.Create();
        }
Beispiel #6
0
        /// <summary>
        /// Create a new type adapter from currect factory
        /// </summary>
        /// <returns>Created type adapter</returns>
        public static ITypeAdapter CreateAdapter()
        {
            if (_currentTypeAdapterFactory == null)
            {
                lock (lock_flag)
                {
                    if (_currentTypeAdapterFactory == null)
                    {
                        _currentTypeAdapterFactory = ObjectContainer.CreateInstance <ITypeAdapterFactory>();
                    }
                }
            }

            return(_currentTypeAdapterFactory.Create());
        }
Beispiel #7
0
        public StoreService(ITypeAdapterFactory typeAdapterFactory, IValidationFactory validationFactory,
            IAddressServiceFactory addressServiceFactory, IStoreLocalizedDetailsServiceFactory storeLocalizedDetailsServiceFactory,
            IStoreRepository storeRepository, IPhoneNumberServiceFactory phoneNumberServiceFactory)
        {
            if (typeAdapterFactory == null)
                throw new ArgumentNullException("typeAdapterFactory");
            if (validationFactory == null)
                throw new ArgumentNullException("validationFactory");
            if (addressServiceFactory == null)
                throw new ArgumentNullException("addressServiceFactory");
            if (storeLocalizedDetailsServiceFactory == null)
                throw new ArgumentNullException("storeLocalizedDetailsServiceFactory");
            if (storeRepository == null)
                throw new ArgumentNullException("storeRepository");
            if (phoneNumberServiceFactory == null)
                throw new ArgumentNullException("phoneNumberServiceFactory");

            this.typeAdapterFactory = typeAdapterFactory;
            this.validationFactory = validationFactory;
            this.addressServiceFactory = addressServiceFactory;
            this.storeLocalizedDetailsServiceFactory = storeLocalizedDetailsServiceFactory;
            this.storeRepository = storeRepository;
            this.phoneNumberServiceFactory = phoneNumberServiceFactory;
        }
Beispiel #8
0
 /// <summary>
 /// Set the current type adapter factory
 /// </summary>
 /// <param name="adapterFactory">The adapter factory to set</param>
 public static void SetCurrent(ITypeAdapterFactory adapterFactory)
 {
     _currentTypeAdapterFactory = adapterFactory;
 }
 /// <summary>
 /// Establece contrato para la factoria del adaptador.
 /// </summary>
 /// <param name="adapterFactory">Contrato de la factoria del adaptador.</param>
 public static void SetCurrent(ITypeAdapterFactory adapterFactory)
 {
     _currentTypeAdapterFactory = adapterFactory;
 }
 /// <summary>
 /// 设置当前要使用的实现类(依赖注入)
 /// </summary>
 /// <param name="current"></param>
 public static void SetCurrent(ITypeAdapterFactory current)
 {
     _typeAdapterFactory = current;
 }
Beispiel #11
0
 public static void SetCurrent(ITypeAdapterFactory typeAdapterFactory)
 {
     currentTypeAdapterFactory = typeAdapterFactory;
 }
Beispiel #12
0
 public static void Set(ITypeAdapterFactory factory)
 {
     _factory = factory;
 }