diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-08-10 11:45:54 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-08-10 11:45:54 +0400 |
commit | b2d02df1287f4fcdeb549f414162ba46247454c4 (patch) | |
tree | 1a04866ce15d9c71b8136367adffe5a5c019488b /main/contrib | |
parent | d6f353a393de3b19f44db6fe8963ef7a17dfc1af (diff) |
Fixed 'Bug 6473 - Refactor-> Create backing store fails on static
properties'.
Diffstat (limited to 'main/contrib')
-rw-r--r-- | main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateBackingStoreAction.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateBackingStoreAction.cs b/main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateBackingStoreAction.cs index 9d90ba3380..df630364fb 100644 --- a/main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateBackingStoreAction.cs +++ b/main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/CreateBackingStoreAction.cs @@ -35,9 +35,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { var property = context.GetNode<PropertyDeclaration>(); if (!(property != null && - !property.Getter.IsNull && !property.Setter.IsNull && // automatic properties always need getter & setter - property.Getter.Body.IsNull && - property.Setter.Body.IsNull)) { + !property.Getter.IsNull && !property.Setter.IsNull && // automatic properties always need getter & setter + property.Getter.Body.IsNull && + property.Setter.Body.IsNull)) { yield break; } @@ -46,6 +46,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring // create field var backingStore = new FieldDeclaration (); + if (property.Modifiers.HasFlag (Modifiers.Static)) + backingStore.Modifiers |= Modifiers.Static; backingStore.ReturnType = property.ReturnType.Clone (); var initializer = new VariableInitializer (backingStoreName); |