Author: lluis
Date: 2005-12-13 09:50:49 -0500 (Tue, 13 Dec 2005)
New Revision: 54293

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs
Log:
2005-12-13 Lluis Sanchez Gual  <[EMAIL PROTECTED]>  

        * MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs: Removed
        anonymous methods.



Modified: trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog   2005-12-13 
14:40:22 UTC (rev 54292)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog   2005-12-13 
14:50:49 UTC (rev 54293)
@@ -1,3 +1,8 @@
+2005-12-13 Lluis Sanchez Gual  <[EMAIL PROTECTED]>  
+
+       * MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs: Removed
+       anonymous methods.
+
 2005-12-13 Lluis Sanchez Gual  <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Projects/DotNetProject.cs:

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs
       2005-12-13 14:40:22 UTC (rev 54292)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs
       2005-12-13 14:50:49 UTC (rev 54293)
@@ -65,11 +65,7 @@
                
                public void RenameClass (IClass cls, string newName, 
RefactoryScope scope)
                {
-                       Refactor (cls, scope,
-                               delegate (IRefactorerContext rctx, IRefactorer 
gen, string file) {
-                                       gen.RenameClassReferences (rctx, file, 
cls, newName);
-                               }
-                       );
+                       Refactor (cls, scope, new RefactorDelegate (new 
RefactorRenameClass (cls, newName).Refactor));
                        
                        InternalRefactorerContext gctx = GetGeneratorContext 
(cls);
                        IRefactorer r = GetGeneratorForClass (cls);
@@ -96,11 +92,7 @@
                
                public void RenameMethod (IClass cls, IMethod method, string 
newName, RefactoryScope scope)
                {
-                       Refactor (cls, scope,
-                               delegate (IRefactorerContext gctx, IRefactorer 
gen, string file) {
-                                       gen.RenameMethodReferences (gctx, file, 
cls, method, newName);
-                               }
-                       );
+                       Refactor (cls, scope, new RefactorDelegate (new 
RefactorRenameMethod (cls, method, newName).Refactor));
                        
                        InternalRefactorerContext rctx = GetGeneratorContext 
(cls);
                        IRefactorer r = GetGeneratorForClass (cls);
@@ -127,12 +119,8 @@
                
                public void RenameField (IClass cls, IField field, string 
newName, RefactoryScope scope)
                {
-                       RefactorDelegate del = delegate (IRefactorerContext 
rctx, IRefactorer r, string file) {
-                               r.RenameFieldReferences (rctx, file, cls, 
field, newName);
-                       };
+                       Refactor (cls, scope, new RefactorDelegate (new 
RefactorRenameField (cls, field, newName).Refactor));
                        
-                       Refactor (cls, scope, del);
-                       
                        InternalRefactorerContext gctx = GetGeneratorContext 
(cls);
                        IRefactorer gen = GetGeneratorForClass (cls);
                        gen.RenameField (gctx, cls, field, newName);
@@ -254,6 +242,61 @@
                }
        }
        
+       class RefactorRenameClass
+       {
+               IClass cls;
+               string newName;
+               
+               public RefactorRenameClass (IClass cls, string newName)
+               {
+                       this.cls = cls;
+                       this.newName = newName;
+               }
+               
+               public void Refactor (IRefactorerContext rctx, IRefactorer gen, 
string file)
+               {
+                       gen.RenameClassReferences (rctx, file, cls, newName);
+               }
+       }
+       
+       class RefactorRenameMethod
+       {
+               IClass cls;
+               string newName;
+               IMethod method;
+               
+               public RefactorRenameMethod (IClass cls, IMethod method, string 
newName)
+               {
+                       this.cls = cls;
+                       this.newName = newName;
+                       this.method = method;
+               }
+               
+               public void Refactor (IRefactorerContext rctx, IRefactorer r, 
string file)
+               {
+                       r.RenameMethodReferences (rctx, file, cls, method, 
newName);
+               }
+       }
+       
+       class RefactorRenameField
+       {
+               IClass cls;
+               string newName;
+               IField field;
+               
+               public RefactorRenameField (IClass cls, IField field, string 
newName)
+               {
+                       this.cls = cls;
+                       this.newName = newName;
+                       this.field = field;
+               }
+               
+               public void Refactor (IRefactorerContext rctx, IRefactorer r, 
string file)
+               {
+                       r.RenameFieldReferences (rctx, file, cls, field, 
newName);
+               }
+       }
+       
        public enum RefactoryScope
        {
                Class,

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to