Created
July 3, 2020 17:28
-
-
Save Yatekii/cbb0ff85a760e4621205071289d664d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (first == "op") | |
{ | |
Expression initialVar = OperationExpression; | |
// We have UI access at hand. Assemble the entire access chain. | |
foreach (var piece in pieces.Skip(1)) | |
{ | |
var number = -1; | |
try | |
{ | |
number = int.Parse(piece); | |
initialVar = Expression.MakeIndex(initialVar, typeof(List<Object>).GetProperty("Item"), new[] { Expression.Constant(number) }); | |
} | |
catch (FormatException) | |
{ | |
initialVar = Expression.PropertyOrField(initialVar, piece); | |
} | |
} | |
return initialVar; | |
} | |
else | |
{ | |
throw new Exception(String.Format("Unkown variable {0}", first)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment