public ScriptEvaluator()
 {
     objectFormatter = CSharpObjectFormatter.Instance;
     printOptions    = new PrintOptions {
         MaximumOutputLength = 114514, EscapeNonPrintableCharacters = true
     };
     parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Script, languageVersion: LanguageVersion.Latest);
 }
        internal static string ToDisplayString(this CSharpObjectFormatter csharpObjectFormatter, Exception ex)
        {
            var builder = new StringBuilder();

            builder.Append(ex.GetType());
            builder.Append(": ");
            builder.Append(csharpObjectFormatter.FormatException(ex));
            return(builder.ToString());
        }
Esempio n. 3
0
        public void ArrayOtInt32_NoMembers()
        {
            CSharpObjectFormatter formatter = CSharpObjectFormatter.Instance;
            object o = new int[4] {
                3, 4, 5, 6
            };
            var str = formatter.FormatObject(o);

            Assert.Equal("int[4] { 3, 4, 5, 6 }", str);
        }
Esempio n. 4
0
 public PrettyPrinter()
 {
     this.objectFormatter = CSharpObjectFormatter.Instance;
 }