protected int GetLength(TargetMemoryAccess target)
{
if (!GetArrayBounds (target))
throw new LocationInvalidException ();
if (!bounds.IsMultiDimensional)
return bounds.Length;
int length = 0;
for (int i = 0; i < Rank; i++)
length *= bounds.UpperBounds [i] - bounds.LowerBounds [i] + 1;
return length;
}