Microsoft.Scripting.Interpreter.CallInstruction.GetArrayAccessor C# (CSharp) Method

GetArrayAccessor() private static method

private static GetArrayAccessor ( MethodInfo info, int argumentCount ) : CallInstruction
info System.Reflection.MethodInfo
argumentCount int
return CallInstruction
        private static CallInstruction GetArrayAccessor(MethodInfo info, int argumentCount) {
            Type arrayType = info.DeclaringType;
            bool isGetter = info.Name == "Get";
            switch (arrayType.GetArrayRank()) {
                case 1:
                    return Create(isGetter ?
                        arrayType.GetMethod("GetValue", new[] { typeof(int)}) :
                        new Action<Array, int, object>(ArrayItemSetter1).Method
                    );
               
                case 2: 
                    return Create(isGetter ? 
                        arrayType.GetMethod("GetValue", new[] { typeof(int), typeof(int) }) :
                        new Action<Array, int, int, object>(ArrayItemSetter2).Method
                    );

                case 3: 
                    return Create(isGetter ?
                        arrayType.GetMethod("GetValue", new[] { typeof(int), typeof(int), typeof(int) }) :
                        new Action<Array, int, int, int, object>(ArrayItemSetter3).Method
                    );

                default: 
                    return new MethodInfoCallInstruction(info, argumentCount);
            }
        }