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

DoAdd() private method

Correct ArgumentException throw by a Dictionary when adding an existing key.
private DoAdd ( Type s, ServiceEntry e ) : void
s System.Type
e ServiceEntry
return void
        void DoAdd( Type s, ServiceEntry e )
        {
            Debug.Assert( !ReferenceEquals( s, null ) );
            try
            {
                _services.Add( s, e );
            }
            catch( ArgumentException ex )
            {
                if( _services.ContainsKey( s ) )
                    throw new CKException( ex, CoreResources.ServiceAlreadyRegistered, s.FullName );
                throw;
            }
        }