|
3 | 3 | using System.Linq; |
4 | 4 | using System.Linq.Expressions; |
5 | 5 | using System.Reflection; |
6 | | -using System.Text; |
7 | | -using System.Threading.Tasks; |
8 | 6 | using ExpressionTreeToString.Util; |
9 | 7 | using static ExpressionTreeVisualizer.Serialization.EndNodeTypes; |
10 | 8 | using static ExpressionTreeToString.Globals; |
11 | 9 | using System.Runtime.CompilerServices; |
12 | | -using static ExpressionTreeToString.FormatterNames; |
13 | 10 | using System.Collections; |
14 | 11 | using ZSpitz.Util; |
15 | 12 | using static ZSpitz.Util.Functions; |
16 | 13 | using ExpressionTreeToString; |
| 14 | +using static ZSpitz.Util.Language; |
17 | 15 |
|
18 | 16 | namespace ExpressionTreeVisualizer.Serialization { |
19 | 17 | [Serializable] |
@@ -68,14 +66,14 @@ public class ExpressionNodeData { |
68 | 66 | internal ExpressionNodeData(object o, (string aggregatePath, string pathFromParent) path, VisualizerData visualizerData, ValueExtractor valueExtractor, Dictionary<string, (int start, int length)> pathSpans, bool isParameterDeclaration = false, PropertyInfo? pi = null, string? parentWatchExpression = null) : |
69 | 67 | this( |
70 | 68 | o, path, |
71 | | - visualizerData.Config.Language, |
| 69 | + OneOfStringLanguageExtensions.ResolveLanguage(visualizerData.Config.Language)!.Value, |
72 | 70 | valueExtractor, |
73 | 71 | pathSpans, isParameterDeclaration, pi, parentWatchExpression |
74 | 72 | ) { } |
75 | 73 |
|
76 | 74 | private ExpressionNodeData( |
77 | 75 | object o, (string aggregatePath, string pathFromParent) path, |
78 | | - string language, |
| 76 | + Language language, |
79 | 77 | ValueExtractor valueExtractor, |
80 | 78 | Dictionary<string, (int start, int length)> pathSpans, bool isParameterDeclaration = false, PropertyInfo? pi = null, string? parentWatchExpression = null |
81 | 79 | ) { |
@@ -212,7 +210,7 @@ private ExpressionNodeData( |
212 | 210 |
|
213 | 211 | string? factoryMethodName = null; |
214 | 212 | if (o is BinaryExpression || o is UnaryExpression) { |
215 | | - BinaryUnaryMethods.TryGetValue(((Expression)o).NodeType, out factoryMethodName); |
| 213 | + Globals.FactoryMethodNames.TryGetValue(((Expression)o).NodeType, out factoryMethodName); |
216 | 214 | } |
217 | 215 | if (factoryMethodName.IsNullOrWhitespace()) { |
218 | 216 | var publicType = o.GetType().BaseTypes(false, true).FirstOrDefault(x => !x.IsInterface && x.IsPublic); |
|
0 commit comments