﻿
    // indigo.data
    // ***********************************************************************************

    indigo.data = {};
    indigo.data._construct = function ()
    {

        var _namespace = "indigo.ui";

        function _objectName(_name)
        {
            return "[" + _namespace + "." + _name + "]";
        }

        function _dataColumn(name, value)
        {
            var _this = this;
            _this.name = name;
            _this.value = value;
            _this._dispose = function ()
            {
                _this.name = null;
                _this.value = null;
            }
        }
        _dataColumn._inherits(indigo.object);
        _dataColumn.prototype.dispose = function ()
        {
            this._dispose();
            _dataColumn._callBase(this);
        };
        _dataColumn.prototype.toString = function ()
        {
            return _objectName("dataColumn");
        };
        this.dataColumn = _dataColumn;

        function _dataRow()
        {
            var _this = this;
            _this.columns = new indigo.collection();
            _this._dispose = function ()
            {
                _this.columns.dispose();
            }
        }
        _dataRow._inherits(indigo.object);
        _dataRow.prototype.dispose = function ()
        {
            this._dispose();
            _dataRow._callBase(this);
        };
        _dataRow.prototype.getValue = function (columnName)
        {
            for (var _i = 0; _i < this.columns.count; _i++)
            {
                if (this.columns.items[_i].name == columnName)
                    return this.columns.items[_i].value;
            }
            return "";
        };
        _dataRow.prototype.toString = function ()
        {
            return _objectName("dataRow");
        };
        this.dataRow = _dataRow;

        function _dataTable()
        {
            var _this = this;
            _this.columns = new indigo.collection();
            _this.rows = new indigo.collection();
            _this._dispose = function ()
            {
                _this.columns.dispose();
                _this.rows.dispose();
            }
        }
        _dataTable._inherits(indigo.object);
        _dataTable.prototype.dispose = function ()
        {
            this._dispose();
            _dataTable._callBase(this);
        };
        _dataTable.prototype.toString = function ()
        {
            return _objectName("dataTable");
        };
        this.dataTable = _dataTable;

        function _dataSet()
        {
            var _this = this;
            _this.tables = new indigo.collection();
            _this._dispose = function ()
            {
                _this.tables.dispose();
            }
        }
        _dataSet._inherits(indigo.object);
        _dataSet.prototype.dispose = function ()
        {
            this._dispose();
            _dataSet._callBase(this);
        };
        _dataSet.prototype.toString = function ()
        {
            return _objectName("dataSet");
        };
        this.dataSet = _dataSet;
    };
    indigo.data._construct();
