Accord.Controls.ArrayDataView.ArrayDataView C# (CSharp) Method

ArrayDataView() public method

Initializes a new ArrayDataView from array.
public ArrayDataView ( Array array ) : System
array System.Array array of data.
return System
        public ArrayDataView(Array array)
        {
            if (array.Rank > 2)
                throw new ArgumentException("Supports only up to two dimensional arrays", "array");

            this.data = array;

            if (array.Rank == 2)
            {
                rowCount = array.GetLength(0);
                colCount = array.GetLength(1);
                type = ArrayDataType.Multidimensional;
            }
            else
            {
                if (array.GetValue(0) is Array)
                {
                    Array row = array.GetValue(0) as Array;

                    rowCount = array.GetLength(0);
                    colCount = row.GetLength(0);
                    type = ArrayDataType.Jagged;
                }
                else
                {
                    rowCount = 1;
                    colCount = array.GetLength(0);
                    type = ArrayDataType.Simple;
                }
            }

            rows = new ArrayRowView[rowCount];
            for (int i = 0; i < rows.Length; i++)
                rows[i] = new ArrayRowView(this, i);
        }

Same methods

ArrayDataView::ArrayDataView ( Array array, object columnNames ) : System
ArrayDataView::ArrayDataView ( Array array, object columnNames, object rowNames ) : System
ArrayDataView::ArrayDataView ( Array array, string columnNames ) : System
ArrayDataView::ArrayDataView ( Array array, string columnNames, string rowNames ) : System