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

◆ ArrayIndex() [2/3]

static MethodCallExpression System.Linq.Expressions.Expression< TDelegate >.ArrayIndex ( Expression< TDelegate > array,
IEnumerable< Expression< TDelegate > > indexes )
inlinestaticinherited

Definition at line 4357 of file Expression.cs.

4358 {
4361 Type type = array.Type;
4362 if (!type.IsArray)
4363 {
4364 throw Error.ArgumentMustBeArray("array");
4365 }
4367 if (type.GetArrayRank() != readOnlyCollection.Count)
4368 {
4369 throw Error.IncorrectNumberOfIndexes();
4370 }
4371 int i = 0;
4372 for (int count = readOnlyCollection.Count; i < count; i++)
4373 {
4376 if (expression.Type != typeof(int))
4377 {
4378 throw Error.ArgumentMustBeArrayIndexType("indexes", i);
4379 }
4380 }
4383 }
static void RequiresNotNull(object value, string paramName)
static void RequiresCanRead(Expression expression, string paramName)
static MethodInfo GetArrayGetMethod(Type arrayType)
Definition TypeUtils.cs:769

References System.Linq.Expressions.Error.ArgumentMustBeArray(), System.Linq.Expressions.Error.ArgumentMustBeArrayIndexType(), System.array, System.Linq.Expressions.Call, System.Linq.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Dynamic.Utils.TypeUtils.GetArrayGetMethod(), System.Linq.Expressions.Error.IncorrectNumberOfIndexes(), System.Dynamic.Utils.ExpressionUtils.RequiresCanRead(), System.Dynamic.Utils.ContractUtils.RequiresNotNull(), and System.type.