@@ -31,9 +31,8 @@ public object GetInterface()
3131 return GetInterface ( null ) ;
3232 }
3333
34- public object GetInterface ( Type type )
34+ public object GetInterface ( [ NotNull ] Type type )
3535 {
36- if ( type == null ) throw new ArgumentNullException ( "type" ) ;
3736 object feature ;
3837 if ( _featureByFeatureType . TryGetValue ( type , out feature ) )
3938 {
@@ -63,10 +62,8 @@ public object GetInterface(Type type)
6362 return null ;
6463 }
6564
66- void SetInterface ( Type type , object feature )
65+ void SetInterface ( [ NotNull ] Type type , object feature )
6766 {
68- if ( type == null ) throw new ArgumentNullException ( "type" ) ;
69-
7067 if ( feature == null )
7168 {
7269 Remove ( type ) ;
@@ -153,27 +150,22 @@ public bool IsReadOnly
153150 get { return false ; }
154151 }
155152
156- public bool ContainsKey ( Type key )
153+ public bool ContainsKey ( [ NotNull ] Type key )
157154 {
158- if ( key == null ) throw new ArgumentNullException ( "key" ) ;
159155 return GetInterface ( key ) != null ;
160156 }
161157
162- public void Add ( Type key , object value )
158+ public void Add ( [ NotNull ] Type key , [ NotNull ] object value )
163159 {
164- if ( key == null ) throw new ArgumentNullException ( "key" ) ;
165- if ( value == null ) throw new ArgumentNullException ( "value" ) ;
166160 if ( ContainsKey ( key ) )
167161 {
168162 throw new ArgumentException ( ) ;
169163 }
170164 SetInterface ( key , value ) ;
171165 }
172166
173- public bool Remove ( Type key )
167+ public bool Remove ( [ NotNull ] Type key )
174168 {
175- if ( key == null ) throw new ArgumentNullException ( "key" ) ;
176-
177169 lock ( _containerSync )
178170 {
179171 Type priorFeatureType ;
@@ -188,7 +180,7 @@ public bool Remove(Type key)
188180 }
189181 }
190182
191- public bool TryGetValue ( Type key , out object value )
183+ public bool TryGetValue ( [ NotNull ] Type key , out object value )
192184 {
193185 value = GetInterface ( key ) ;
194186 return value != null ;
0 commit comments