Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
IndexExpression.cs
Go to the documentation of this file.
6
8
9[DebuggerTypeProxy(typeof(IndexExpressionProxy))]
11{
13
14 public sealed override ExpressionType NodeType => ExpressionType.Index;
15
16 public sealed override Type Type
17 {
18 get
19 {
20 if (Indexer != null)
21 {
22 return Indexer.PropertyType;
23 }
24 return Object.Type.GetElementType();
25 }
26 }
27
28 public Expression? Object { get; }
29
30 public PropertyInfo? Indexer { get; }
31
33
35
37 {
38 _ = indexer == null;
39 Object = instance;
42 }
43
45 {
46 if (@object == Object && arguments != null && ExpressionUtils.SameElements(ref arguments, Arguments))
47 {
48 return this;
49 }
50 return Expression.MakeIndex(@object, Indexer, arguments);
51 }
52
54 {
55 return _arguments[index];
56 }
57
58 protected internal override Expression Accept(ExpressionVisitor visitor)
59 {
60 return visitor.VisitIndex(this);
61 }
62
64 {
65 return Expression.MakeIndex(instance, Indexer, arguments ?? _arguments);
66 }
67}
static ReadOnlyCollection< ParameterExpression > ReturnReadOnly(IParameterProvider provider, ref object collection)
static IndexExpression MakeIndex(Expression instance, PropertyInfo? indexer, IEnumerable< Expression >? arguments)
IReadOnlyList< Expression > _arguments
Expression Rewrite(Expression instance, Expression[] arguments)
override Expression Accept(ExpressionVisitor visitor)
ReadOnlyCollection< Expression > Arguments
IndexExpression Update(Expression @object, IEnumerable< Expression >? arguments)
IndexExpression(Expression instance, PropertyInfo indexer, IReadOnlyList< Expression > arguments)