Thinktecture.Tools.Web.Services.CodeGeneration.CodeRefactoringAgent.RefactorMethods C# (CSharp) Method

RefactorMethods() private method

This method updates the references in methods.
private RefactorMethods ( FilteredTypeMembers methods, string oldName, string newName ) : void
methods FilteredTypeMembers
oldName string
newName string
return void
        private void RefactorMethods(FilteredTypeMembers methods, string oldName, string newName)
        {
            // Do this for all member extensions wrapping methods.
            foreach (CodeTypeMemberExtension memberExtension in methods)
            {
                // Get a reference to the underlying CodeMemberMethod object.
                CodeMemberMethod method = (CodeMemberMethod)memberExtension.ExtendedObject;
                // Update the parameters types.
                RefactorMethodParameterReferences(method.Parameters, oldName, newName);
                // Do we have a return type?
                if (method.ReturnType != null)
                {
                    // Update the return type if necessary.
                    RefactorCodeTypeReference(method.ReturnType, oldName, newName);
                }
                // Update method attributes.
                RefactorCodeTypeReferencesInAttributes(method.CustomAttributes, oldName, newName);
                // Update the statements.
                RefactorCodeStatements(method.Statements, oldName, newName);
            }
        }