/// <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; } }
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(); }
/// <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()); }
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; }
/// <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; }
public static void SetCurrent(ITypeAdapterFactory typeAdapterFactory) { currentTypeAdapterFactory = typeAdapterFactory; }
public static void Set(ITypeAdapterFactory factory) { _factory = factory; }