/// <summary> /// Registers a customizer that will be applied for all service clients created. Each customizer has a unique name associated with it. If a customizer is registered more /// than once with the same unique name then the calls after the first will be ignored. /// </summary> /// <param name="customizer"></param> public void Register(IRuntimePipelineCustomizer customizer) { _rwlock.EnterWriteLock(); try { // If the customizer is already registered then skip adding it again. This could happen if 2 separate libraries are added // to a project and they both one to turn on a third party customizer if (_customizers.FirstOrDefault(x => string.Equals(x.UniqueName, customizer.UniqueName)) != null) { _logger.InfoFormat("Skipping registration because runtime pipeline customizer {0} already registered", customizer.UniqueName); return; } _logger.InfoFormat("Registering runtime pipeline customizer {0}", customizer.UniqueName); _customizers.Add(customizer); } finally { _rwlock.ExitWriteLock(); } }
/// <summary> /// Deregistered the runtime pipeline customizer /// </summary> /// <param name="customizer"></param> public void Deregister(IRuntimePipelineCustomizer customizer) { Deregister(customizer.UniqueName); }