CK.Core.SimpleServiceContainer.AddDisabled C# (CSharp) Method

AddDisabled() public method

Disables a service: null will always be returned by this IServiceProvider.GetService regardless of any fallbacks from BaseProvider. Direct services returned by GetDirectService can not be disabled.
This is not the same as calling Add(Type,Func{Object},Action{Object}) with a null instance. A null instance for a service (a callback that always returns null) is nearly the same as calling Remove: any fallbacks (to a base IServiceProvider for example) can occur. This is stronger since this must prevent fallbacks.
public AddDisabled ( Type serviceType ) : ISimpleServiceContainer
serviceType System.Type Service type to disable. It must not already exist in this container otherwise an exception is thrown.
return ISimpleServiceContainer
        public ISimpleServiceContainer AddDisabled( Type serviceType )
        {
            if( ReferenceEquals( serviceType, null ) ) throw new ArgumentNullException( "serviceType" );
            if( GetDirectService( serviceType ) != null ) throw new CKException( CoreResources.DirectServicesCanNotBeDisabled, serviceType.FullName );
            DoAdd( serviceType, new ServiceEntry() );
            return this;
        }