示例#1
0
        private void ConvertToMethod(GetterDeclaration getterDeclaration)
        {
            var methodDeclaration = new MethodDeclaration(
                getterDeclaration.Context,
                "get" + getterDeclaration.Name[0].ToString().ToUpper() + getterDeclaration.Name.Substring(1),
                getterDeclaration.ReturnType.Yield()
                .Concat <INode>(getterDeclaration.Body.Yield())
                );

            methodDeclaration.Modifiers.AddRange(getterDeclaration.Modifiers);
            getterDeclaration.ReplaceWith(methodDeclaration);
            replacedGetters.Add(getterDeclaration, methodDeclaration);
        }