Example #1
0
        public ArrayElement GetItemLocation(int index)
        {
            ArrayElement point;

            if (index < 0 || index >= m_Items.Length)
            {
                throw new IndexOutOfRangeException("Index is out of range");
            }

            point     = new ArrayElement();
            point.Row = index / this.ArraySize.Cols;
            point.Col = index - (point.Row * this.ArraySize.Rows);

            return(point);
        }
Example #2
0
 public int GetItemIndex(ArrayElement point)
 {
     return(this.GetItemIndex(point.Row, point.Col));
 }
Example #3
0
 public T this[ArrayElement location]
 {
     get { return(this[location.Row, location.Col]); }
     set { this[location.Row, location.Col] = value; }
 }