private CodeExpression RewriteAnonymousArrayExpression(CodeAnonymousArrayExpression expression)
            {
                var converted = new CodeArrayInitializerExpression();
                foreach (var element in expression.Elements)
                {
                    converted.Add(element);
                }

                return this.RewriteArrayInitializerExpression(converted);
            }
            private CodeSnippetExpression RewriteArrayInitializerExpression(CodeArrayInitializerExpression arrayInitializer)
            {
                using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture))
                {
                    sw.Write("{ ");
                    sw.WriteLine();
                    this.nestingLevel++;
                    try
                    {
                        foreach (CodeExpression expr in arrayInitializer.Values)
                        {
                            this.WriteIndentation(sw);
                            this.generator.GenerateCodeFromExpression(expr, sw, null);
                            sw.WriteLine(", ");
                        }
                    }
                    finally
                    {
                        this.nestingLevel--;
                    }

                    this.WriteIndentation(sw);
                    sw.Write(" }");
                    return new CodeSnippetExpression(sw.ToString());
                }
            }
 private CodeSnippetExpression RewriteArrayInitializerExpression(CodeArrayInitializerExpression arrayInitializer)
 {
     using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture))
     {
         sw.Write("{ ");
         for (int i = 0; i < arrayInitializer.Values.Count; i++)
         {
             var expr = arrayInitializer.Values[i];
             this.generator.GenerateCodeFromExpression(expr, sw, null);
             if (i < arrayInitializer.Values.Count - 1)
             {
                 sw.Write(", ");
             }
         }
         
         sw.Write(" }");
         return new CodeSnippetExpression(sw.ToString());
     }
 }