﻿var Controls = {};

/// <reference path="Controls.js" />


Controls.Control = function (id, obj) {
    //#region private fields
    var _thisRef = this;
    obj = obj || {};
    //#endregion
    //#region private methods
    function _getSelf() { return $('#' + _thisRef.id); }
    //#endregion
    //#region public fields
    this.id = id;
    this.display = obj.display || 'block';
    //#endregion 
    //#region public properties
    this.visible = function (val) {
        if (val) _getSelf().css('display', val ? this.display : 'none');
        else return _getSelf.css('display') != 'none';
    }
    //#endregion
}

Controls.DatabindedControl = function (id, obj) {

    //#region private fields
    var _thisRef = this;
    //#endregion

    //#region base constructor call
    Controls.Control.call(this, id, obj);
    //#endregion


    this.dataSource = null;

    this.dataBind = function () { alert("Необходимо переопределить метод databind"); }
}


