예제 #1
0
 public ArrayType(TypeReference elementType, int rank) : base(elementType)
 {
     m_dimensions = new ArrayDimensionCollection(this);
     for (int i = 0; i < rank; i++)
     {
         m_dimensions.Add(new ArrayDimension(0, 0));
     }
 }
예제 #2
0
        internal ArrayType(TypeReference elementType, ArrayShape shape) : base(elementType)
        {
            m_dimensions = new ArrayDimensionCollection(this);
            for (int i = 0; i < shape.Rank; i++)
            {
                int lower = 0, upper = 0;
                if (i < shape.NumSizes)
                {
                    if (i < shape.NumLoBounds)
                    {
                        lower = shape.LoBounds [i];
                        upper = shape.LoBounds [i] + shape.Sizes [i] - 1;
                    }
                    else
                    {
                        upper = shape.Sizes [i] - 1;
                    }
                }

                m_dimensions.Add(new ArrayDimension(lower, upper));
            }
        }