@@ -176,15 +176,15 @@ private static void GetInstrumentableTypes(IEnumerable<TypeDefinition> typeDefin
176
176
}
177
177
if ( typeDefinition . HasNestedTypes )
178
178
GetInstrumentableTypes ( typeDefinition . NestedTypes , classes , filter , moduleName ) ;
179
- }
179
+ }
180
180
}
181
181
182
182
183
183
public Method [ ] GetMethodsForType ( Class type , File [ ] files )
184
184
{
185
185
var methods = new List < Method > ( ) ;
186
186
IEnumerable < TypeDefinition > typeDefinitions = SourceAssembly . MainModule . Types ;
187
- GetMethodsForType ( typeDefinitions , type . FullName , methods , files , _filter ) ;
187
+ GetMethodsForType ( typeDefinitions , type . FullName , methods , files , _filter , _commandLine ) ;
188
188
return methods . ToArray ( ) ;
189
189
}
190
190
@@ -201,54 +201,54 @@ private static string GetFirstFile(MethodDefinition definition)
201
201
return null ;
202
202
}
203
203
204
- private static void GetMethodsForType ( IEnumerable < TypeDefinition > typeDefinitions , string fullName , List < Method > methods , File [ ] files , IFilter filter )
204
+ private static void GetMethodsForType ( IEnumerable < TypeDefinition > typeDefinitions , string fullName , List < Method > methods , File [ ] files , IFilter filter , ICommandLine commandLine )
205
205
{
206
206
foreach ( var typeDefinition in typeDefinitions )
207
207
{
208
208
if ( typeDefinition . FullName == fullName )
209
209
{
210
- BuildPropertyMethods ( methods , files , filter , typeDefinition ) ;
211
- BuildMethods ( methods , files , filter , typeDefinition ) ;
210
+ BuildPropertyMethods ( methods , files , filter , typeDefinition , commandLine ) ;
211
+ BuildMethods ( methods , files , filter , typeDefinition , commandLine ) ;
212
212
}
213
213
if ( typeDefinition . HasNestedTypes )
214
- GetMethodsForType ( typeDefinition . NestedTypes , fullName , methods , files , filter ) ;
214
+ GetMethodsForType ( typeDefinition . NestedTypes , fullName , methods , files , filter , commandLine ) ;
215
215
}
216
216
}
217
217
218
- private static void BuildMethods ( ICollection < Method > methods , File [ ] files , IFilter filter , TypeDefinition typeDefinition )
218
+ private static void BuildMethods ( ICollection < Method > methods , File [ ] files , IFilter filter , TypeDefinition typeDefinition , ICommandLine commandLine )
219
219
{
220
220
foreach ( var methodDefinition in typeDefinition . Methods )
221
221
{
222
222
if ( methodDefinition . IsAbstract ) continue ;
223
223
if ( methodDefinition . IsGetter ) continue ;
224
224
if ( methodDefinition . IsSetter ) continue ;
225
225
226
- var method = BuildMethod ( files , filter , methodDefinition , false ) ;
226
+ var method = BuildMethod ( files , filter , methodDefinition , false , commandLine ) ;
227
227
methods . Add ( method ) ;
228
228
}
229
229
}
230
230
231
- private static void BuildPropertyMethods ( ICollection < Method > methods , File [ ] files , IFilter filter , TypeDefinition typeDefinition )
231
+ private static void BuildPropertyMethods ( ICollection < Method > methods , File [ ] files , IFilter filter , TypeDefinition typeDefinition , ICommandLine commandLine )
232
232
{
233
233
foreach ( var propertyDefinition in typeDefinition . Properties )
234
234
{
235
235
var skipped = filter . ExcludeByAttribute ( propertyDefinition ) ;
236
236
237
237
if ( propertyDefinition . GetMethod != null && ! propertyDefinition . GetMethod . IsAbstract )
238
238
{
239
- var method = BuildMethod ( files , filter , propertyDefinition . GetMethod , skipped ) ;
239
+ var method = BuildMethod ( files , filter , propertyDefinition . GetMethod , skipped , commandLine ) ;
240
240
methods . Add ( method ) ;
241
241
}
242
242
243
243
if ( propertyDefinition . SetMethod != null && ! propertyDefinition . SetMethod . IsAbstract )
244
244
{
245
- var method = BuildMethod ( files , filter , propertyDefinition . SetMethod , skipped ) ;
245
+ var method = BuildMethod ( files , filter , propertyDefinition . SetMethod , skipped , commandLine ) ;
246
246
methods . Add ( method ) ;
247
247
}
248
248
}
249
249
}
250
250
251
- private static Method BuildMethod ( IEnumerable < File > files , IFilter filter , MethodDefinition methodDefinition , bool alreadySkippedDueToAttr )
251
+ private static Method BuildMethod ( IEnumerable < File > files , IFilter filter , MethodDefinition methodDefinition , bool alreadySkippedDueToAttr , ICommandLine commandLine )
252
252
{
253
253
var method = new Method ( ) ;
254
254
method . Name = methodDefinition . FullName ;
@@ -262,6 +262,8 @@ private static Method BuildMethod(IEnumerable<File> files, IFilter filter, Metho
262
262
method . MarkAsSkipped ( SkippedMethod . Attribute ) ;
263
263
else if ( filter . ExcludeByFile ( GetFirstFile ( methodDefinition ) ) )
264
264
method . MarkAsSkipped ( SkippedMethod . File ) ;
265
+ else if ( commandLine . SkipAutoImplementedProperties && filter . IsAutoImplementedProperty ( methodDefinition ) )
266
+ method . MarkAsSkipped ( SkippedMethod . AutoImplementedProperty ) ;
265
267
266
268
var definition = methodDefinition ;
267
269
method . FileRef = files . Where ( x => x . FullPath == GetFirstFile ( definition ) )
0 commit comments