Browse Source

Simplify TransformAutomaticProperties-GetSymbol

pull/728/head
Siegfried Pammer 10 years ago
parent
commit
9064980a2f
  1. 7
      ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs

7
ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs

@ -957,11 +957,8 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
PropertyDeclaration TransformAutomaticProperties(PropertyDeclaration property) PropertyDeclaration TransformAutomaticProperties(PropertyDeclaration property)
{ {
var propertyInfo = property.GetSymbol() as IProperty; PropertyDefinition cecilProperty = context.TypeSystem.GetCecil(property.GetSymbol() as IProperty) as PropertyDefinition;
if (propertyInfo == null) if (cecilProperty == null || cecilProperty.GetMethod == null || cecilProperty.SetMethod == null)
return null;
PropertyDefinition cecilProperty = context.TypeSystem.GetCecil(propertyInfo) as PropertyDefinition;
if (cecilProperty == null || propertyInfo.Getter == null || propertyInfo.Setter == null)
return null; return null;
if (!(cecilProperty.GetMethod.IsCompilerGenerated() && cecilProperty.SetMethod.IsCompilerGenerated())) if (!(cecilProperty.GetMethod.IsCompilerGenerated() && cecilProperty.SetMethod.IsCompilerGenerated()))
return null; return null;

Loading…
Cancel
Save