Пример #1
0
            CodeAction GetAction(BaseRefactoringContext context, Expression targetExpression,
                                 IMember member)
            {
                var    builder     = context.CreateTypeSystemAstBuilder(targetExpression);
                var    newType     = builder.ConvertType(member.DeclaringType);
                string description = string.Format("{0} '{1}'", context.TranslateString("Use base qualifier"), newType.ToString());

                return(new CodeAction(description, script => {
                    script.Replace(targetExpression, newType);
                }, targetExpression));
            }
            static Expression CreateDefaultValueExpression(BaseRefactoringContext ctx, AstNode node, IType type, object constantValue)
            {
                var astBuilder = ctx.CreateTypeSystemAstBuilder(node);

                return(astBuilder.ConvertConstantValue(type, constantValue));
            }