Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ VisitConstant()

override Expression System.Linq.Expressions.DebugViewWriter.VisitConstant ( ConstantExpression node)
inlinepackagevirtual

Reimplemented from System.Linq.Expressions.ExpressionVisitor.

Definition at line 481 of file DebugViewWriter.cs.

482 {
483 object value = node.Value;
484 if (value == null)
485 {
486 Out("null");
487 }
488 else if (value is string && node.Type == typeof(string))
489 {
490 Out($"\"{value}\"");
491 }
492 else if (value is char && node.Type == typeof(char))
493 {
494 Out($"'{value}'");
495 }
496 else if ((value is int && node.Type == typeof(int)) || (value is bool && node.Type == typeof(bool)))
497 {
498 Out(value.ToString());
499 }
500 else
501 {
503 if (constantValueSuffix != null)
504 {
505 Out(value.ToString());
507 }
508 else
509 {
510 Out($".Constant<{node.Type}>({value})");
511 }
512 }
513 return node;
514 }
static string GetConstantValueSuffix(Type type)

References System.Linq.Expressions.DebugViewWriter.GetConstantValueSuffix(), System.Reflection.Out, and System.value.