Пример #1
0
        public void resize(int nRows, int nCols)
        {
            AlphaNumeric[,] newData = new AlphaNumeric[nRows, nCols];

            for (int i = 0; i < nRows; i++)
            {
                for (int j = 0; j < nCols; j++)
                {
                    // Set to default value
                    newData[i, j] = new AlphaNumeric(DefaultValue);

                    // Copy old data to new data if possible
                    if (i < RowCount && j < ColumnCount)
                    {
                        newData[i, j] = new AlphaNumeric(Data[i, j]);
                    }
                }
            }

            Data        = newData;
            RowCount    = nRows;
            ColumnCount = nCols;
        }