Beispiel #1
0
        private static void UpdateMethodBody(DocumentEditor editor, IMethodSymbol methodSymbol, string src)
        {
            var syntaxNode = methodSymbol.DeclaringSyntaxReferences[0].GetSyntax();
            var language   = methodSymbol.Language;

            if (language == LanguageNames.CSharp)
            {
                CSharp.UpdateMethodBody(editor, syntaxNode, src);
            }
            else if (language == LanguageNames.VisualBasic)
            {
                VisualBasic.UpdateMethodBody(editor, syntaxNode, src);
            }
            else
            {
                throw new NotSupportedException(string.Format("Language {0} is not supported.", language));
            }
        }