@@ -156,10 +156,10 @@ private void RegisterConfiguration(IWindsorContainer container, Assembly[] assem
156
156
{
157
157
foreach ( var assembly in assembliesToRegister )
158
158
{
159
- var assemblyClasses = assembly . GetTypes ( )
160
- . Where ( w => _initialSettings . EnableExperimentalFeatures || Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
159
+ var assemblyTypes = assembly . DefinedTypes
160
+ . Where ( w => _initialSettings . EnableExperimentalFeatures || ! Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
161
161
162
- container . Register ( Classes . From ( assemblyClasses )
162
+ container . Register ( Classes . From ( assemblyTypes )
163
163
. InSameNamespaceAs < Configuration > ( )
164
164
. WithService . AllInterfaces ( )
165
165
. LifestyleSingleton ( ) ) ;
@@ -189,10 +189,12 @@ private void ApplyDefaultInterfaceConvention(IWindsorContainer container, Assemb
189
189
{
190
190
foreach ( var assembly in assembliesToRegister )
191
191
{
192
- var assemblyClasses = assembly . GetTypes ( )
193
- . Where ( w => _initialSettings . EnableExperimentalFeatures || Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
192
+ var assemblyTypes = assembly . DefinedTypes
193
+ . Where ( w => _initialSettings . EnableExperimentalFeatures || ! Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
194
+
195
+ assemblyTypes . Any ( t => t . Name == nameof ( IMessageBox ) ) ;
194
196
195
- container . Register ( Classes . From ( assemblyClasses )
197
+ container . Register ( Classes . From ( assemblyTypes )
196
198
. Where ( type => type . Namespace != null
197
199
&& ! type . Namespace . StartsWith ( "Rubberduck.VBEditor.SafeComWrappers" )
198
200
&& ! type . Name . Equals ( "SelectionChangeService" )
@@ -209,10 +211,10 @@ private void RegisterFactories(IWindsorContainer container, Assembly[] assemblie
209
211
{
210
212
foreach ( var assembly in assembliesToRegister )
211
213
{
212
- var assemblyClasses = assembly . GetTypes ( )
213
- . Where ( w => _initialSettings . EnableExperimentalFeatures || Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
214
+ var assemblyTypes = assembly . DefinedTypes
215
+ . Where ( w => _initialSettings . EnableExperimentalFeatures || ! Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
214
216
215
- container . Register ( Classes . From ( assemblyClasses )
217
+ container . Register ( Types . From ( assemblyTypes )
216
218
. Where ( type => type . IsInterface && type . Name . EndsWith ( "Factory" ) )
217
219
. Configure ( c => c . AsFactory ( ) )
218
220
. LifestyleSingleton ( ) ) ;
@@ -233,10 +235,10 @@ private void RegisterQuickFixes(IWindsorContainer container, Assembly[] assembli
233
235
{
234
236
foreach ( var assembly in assembliesToRegister )
235
237
{
236
- var assemblyClasses = assembly . GetTypes ( )
237
- . Where ( w => _initialSettings . EnableExperimentalFeatures || Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
238
+ var assemblyTypes = assembly . DefinedTypes
239
+ . Where ( w => _initialSettings . EnableExperimentalFeatures || ! Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
238
240
239
- container . Register ( Classes . From ( assemblyClasses )
241
+ container . Register ( Classes . From ( assemblyTypes )
240
242
. BasedOn < IQuickFix > ( )
241
243
. WithService . Base ( )
242
244
. WithService . Self ( )
@@ -248,10 +250,10 @@ private void RegisterInspections(IWindsorContainer container, Assembly[] assembl
248
250
{
249
251
foreach ( var assembly in assembliesToRegister )
250
252
{
251
- var assemblyClasses = assembly . GetTypes ( )
252
- . Where ( w => _initialSettings . EnableExperimentalFeatures || Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
253
+ var assemblyTypes = assembly . DefinedTypes
254
+ . Where ( w => _initialSettings . EnableExperimentalFeatures || ! Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
253
255
254
- container . Register ( Classes . From ( assemblyClasses )
256
+ container . Register ( Classes . From ( assemblyTypes )
255
257
. BasedOn < IInspection > ( )
256
258
. WithService . Base ( )
257
259
. LifestyleTransient ( ) ) ;
@@ -262,10 +264,10 @@ private void RegisterParseTreeInspections(IWindsorContainer container, Assembly[
262
264
{
263
265
foreach ( var assembly in assembliesToRegister )
264
266
{
265
- var assemblyClasses = assembly . GetTypes ( )
266
- . Where ( w => _initialSettings . EnableExperimentalFeatures || Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
267
+ var assemblyTypes = assembly . DefinedTypes
268
+ . Where ( w => _initialSettings . EnableExperimentalFeatures || ! Attribute . IsDefined ( w , typeof ( ExperimentalAttribute ) ) ) ;
267
269
268
- container . Register ( Classes . From ( assemblyClasses )
270
+ container . Register ( Classes . From ( assemblyTypes )
269
271
. BasedOn < IParseTreeInspection > ( )
270
272
. WithService . Base ( )
271
273
. WithService . Select ( new [ ] { typeof ( IInspection ) } )
0 commit comments