/// <summary> /// /// </summary> /// <param name="key"></param> /// <param name="serviceType"></param> /// <param name="classType"></param> /// <param name="parameters"></param> public virtual void AddComponentWithProperties(String key, Type serviceType, Type classType, IDictionary parameters) { if (key == null) { throw new ArgumentNullException("key"); } if (parameters == null) { throw new ArgumentNullException("parameters"); } if (serviceType == null) { throw new ArgumentNullException("serviceType"); } if (classType == null) { throw new ArgumentNullException("classType"); } ComponentModel model = ComponentModelBuilder.BuildModel(key, serviceType, classType, parameters); RaiseComponentModelCreated(model); IHandler handler = HandlerFactory.Create(model); RegisterHandler(key, handler); }
public void AddComponent(string key, Type serviceType, Type classType, LifestyleType lifestyle, bool overwriteLifestyle) { if (key == null) { throw new ArgumentNullException("key"); } if (serviceType == null) { throw new ArgumentNullException("serviceType"); } if (classType == null) { throw new ArgumentNullException("classType"); } if (LifestyleType.Undefined == lifestyle) { throw new ArgumentException("The specified lifestyle must be Thread, Transient, or Singleton.", "lifestyle"); } var model = ComponentModelBuilder.BuildModel(new ComponentName(key, true), new[] { serviceType }, classType, null); if (overwriteLifestyle || LifestyleType.Undefined == model.LifestyleType) { model.LifestyleType = lifestyle; } RaiseComponentModelCreated(model); var handler = HandlerFactory.Create(model); RegisterHandler(key, handler); }
public virtual void AddComponentWithExtendedProperties(String key, Type serviceType, Type classType, IDictionary extendedProperties) { if (key == null) { throw new ArgumentNullException("key"); } if (extendedProperties == null) { throw new ArgumentNullException("extendedProperties"); } if (serviceType == null) { throw new ArgumentNullException("serviceType"); } if (classType == null) { throw new ArgumentNullException("classType"); } var model = ComponentModelBuilder.BuildModel(new ComponentName(key, true), new[] { serviceType }, classType, extendedProperties); RaiseComponentModelCreated(model); var handler = HandlerFactory.Create(model); RegisterHandler(key, handler); }
public void AddComponent(string key, Type serviceType, Type classType, LifestyleType lifestyle, bool overwriteLifestyle) { if (key == null) { throw new ArgumentNullException(nameof(key)); } if (serviceType == null) { throw new ArgumentNullException(nameof(serviceType)); } if (classType == null) { throw new ArgumentNullException(nameof(classType)); } if (LifestyleType.Undefined == lifestyle) { throw new ArgumentException("The specified lifestyle must be Thread, Transient, or Singleton.", nameof(lifestyle)); } var model = ComponentModelBuilder.BuildModel(new ComponentName(key, true), new[] { serviceType }, classType, null); if (overwriteLifestyle || LifestyleType.Undefined == model.LifestyleType) { model.LifestyleType = lifestyle; } AddCustomComponent(model); }
public virtual void AddComponent(String key, Type classType) { if (key == null) { throw new ArgumentNullException("key"); } if (classType == null) { throw new ArgumentNullException("classType"); } ComponentModel model = ComponentModelBuilder.BuildModel(key, classType, classType, null); RaiseComponentModelCreated(model); IHandler handler = HandlerFactory.Create(model); RegisterHandler(key, handler); }
public virtual void AddComponentWithExtendedProperties(String key, Type classType, IDictionary extendedProperties) { if (key == null) { throw new ArgumentNullException("key"); } if (extendedProperties == null) { throw new ArgumentNullException("extendedProperties"); } if (classType == null) { throw new ArgumentNullException("classType"); } var model = ComponentModelBuilder.BuildModel(new ComponentName(key, true), new[] { classType }, classType, extendedProperties); AddCustomComponent(model); }