Ejemplo n.º 1
0
        internal static object GetArrayIndex(BinaryExpression node)
        {
            node.MustNotBeNull();
            if (node.NodeType != ExpressionType.ArrayIndex)
            {
                throw new NotSupportedException("Only array indexes are supported");
            }
            var arr = node.Left.GetValue().CastAs <Array>();
            var idx = node.Right.GetValue();

            if (idx is int)
            {
                return(arr.GetValue((int)idx));
            }
            //if (idx is long)
            //{

            //    return arr.((long) idx);
            //}
            throw new NotSupportedException();
        }