Browse Source

simplify CreatePropertiesCommand

pull/23/head
Siegfried Pammer 14 years ago
parent
commit
f96c48ad56
  1. 4
      src/AddIns/Misc/SharpRefactoring/Project/Src/CreateProperties.cs
  2. 3
      src/AddIns/Misc/SharpRefactoring/Project/Src/CreatePropertiesCommand.cs

4
src/AddIns/Misc/SharpRefactoring/Project/Src/CreateProperties.cs

@ -27,7 +27,7 @@ namespace SharpRefactoring
return null; return null;
} }
CreatePropertiesDialog CreateDialog(InsertionContext context) internal static CreatePropertiesDialog CreateDialog(InsertionContext context)
{ {
ITextEditor textEditor = context.TextArea.GetService(typeof(ITextEditor)) as ITextEditor; ITextEditor textEditor = context.TextArea.GetService(typeof(ITextEditor)) as ITextEditor;
@ -68,7 +68,7 @@ namespace SharpRefactoring
return dialog; return dialog;
} }
IEnumerable<FieldWrapper> FindFields(IClass sourceClass) static IEnumerable<FieldWrapper> FindFields(IClass sourceClass)
{ {
int i = 0; int i = 0;

3
src/AddIns/Misc/SharpRefactoring/Project/Src/CreatePropertiesCommand.cs

@ -8,6 +8,7 @@ using ICSharpCode.SharpDevelop.Dom.Refactoring;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.AvalonEdit; using ICSharpCode.SharpDevelop.Editor.AvalonEdit;
using ICSharpCode.SharpDevelop.Refactoring; using ICSharpCode.SharpDevelop.Refactoring;
using SharpRefactoring.Gui;
namespace SharpRefactoring namespace SharpRefactoring
{ {
@ -17,7 +18,7 @@ namespace SharpRefactoring
{ {
new Snippet { new Snippet {
Elements = { Elements = {
new CreateProperties().GetElement(new SnippetInfo("refactoring:propall", "${refactoring:propall}", 0)) new InlineRefactorSnippetElement(context => CreateProperties.CreateDialog(context), "")
} }
}.Insert((TextArea)textEditor.GetService(typeof(TextArea))); }.Insert((TextArea)textEditor.GetService(typeof(TextArea)));
} }

Loading…
Cancel
Save