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

Remove() public method

Unregisters a service. Can be called even if the service does not exist. The service is first removed and then the OnRemove associated action is called if it exists.
public Remove ( Type serviceType ) : ISimpleServiceContainer
serviceType System.Type Service type to unregister.
return ISimpleServiceContainer
        public ISimpleServiceContainer Remove( Type serviceType )
        {
            ServiceEntry e;
            if( _services.TryGetValue( serviceType, out e ) )
            {
                _services.Remove( serviceType );
                if( e.Instance != null && e.OnRemove != null ) e.OnRemove( e.Instance );
            }
            return this;
        }