/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { IDictionary$2_$type } from "igniteui-react-core/ES5/IDictionary$2";
import { Base, Type, markType } from "igniteui-react-core/ES5/type";
import { Dictionary$2 } from "igniteui-react-core/ES5/Dictionary$2";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { OrderedDictionary_Enumerator$2 } from "./OrderedDictionary_Enumerator$2";
var OrderedDictionary$2 = /** @class */ (function (_super) {
    tslib_1.__extends(OrderedDictionary$2, _super);
    function OrderedDictionary$2($tKey, $tValue) {
        var _this = _super.call(this) || this;
        _this.$tKey = null;
        _this.$tValue = null;
        _this.b = null;
        _this.c = null;
        _this.$tKey = $tKey;
        _this.$tValue = $tValue;
        _this.$type = _this.$type.specialize(_this.$tKey, _this.$tValue);
        _this.b = new Dictionary$2(_this.$tKey, _this.$tValue, 0);
        _this.c = new List$1(_this.$tKey, 0);
        return _this;
    }
    OrderedDictionary$2.prototype.item1 = function (a) {
        return this.c._inner[a];
    };
    OrderedDictionary$2.prototype.item = function (a, b) {
        if (arguments.length === 2) {
            var c = this.c.indexOf(a);
            this.c._inner[c] = a;
            this.b.item(a, b);
            return b;
        }
        else {
            return this.b.item(a);
        }
    };
    Object.defineProperty(OrderedDictionary$2.prototype, "count", {
        get: function () {
            return this.b.count;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "isReadOnly", {
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "keys", {
        get: function () {
            return this.c;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "values", {
        get: function () {
            return this.b.values;
        },
        enumerable: true,
        configurable: true
    });
    OrderedDictionary$2.prototype.add = function (a) {
        this.addItem(a.key, a.value);
    };
    OrderedDictionary$2.prototype.addItem = function (a, b) {
        this.b.addItem(a, b);
        this.c.add(a);
    };
    OrderedDictionary$2.prototype.clear = function () {
        this.b.clear();
        this.c.clear();
    };
    OrderedDictionary$2.prototype.contains = function (a) {
        return this.b.contains(a);
    };
    OrderedDictionary$2.prototype.containsKey = function (a) {
        return this.b.containsKey(a);
    };
    OrderedDictionary$2.prototype.copyTo = function (a, b) {
        this.b.copyTo(a, b);
    };
    OrderedDictionary$2.prototype.getEnumerator = function () {
        return new OrderedDictionary_Enumerator$2(this.$tKey, this.$tValue, this);
    };
    OrderedDictionary$2.prototype.remove = function (a) {
        return this.removeItem(a.key);
    };
    OrderedDictionary$2.prototype.removeItem = function (a) {
        return this.b.removeItem(a) && this.c.remove(a);
    };
    OrderedDictionary$2.prototype.tryGetValue = function (a, b) {
        if (this.b.containsKey(a)) {
            b = this.b.item(a);
            return {
                ret: true,
                p1: b
            };
        }
        b = Type.getDefaultValue(this.$tValue);
        return {
            ret: false,
            p1: b
        };
    };
    OrderedDictionary$2.prototype.getEnumeratorObject = function () {
        return new OrderedDictionary_Enumerator$2(this.$tKey, this.$tValue, this);
    };
    OrderedDictionary$2.$t = markType(OrderedDictionary$2, 'OrderedDictionary$2', Base.$, [IDictionary$2_$type.specialize(0, 1)]);
    return OrderedDictionary$2;
}(Base));
export { OrderedDictionary$2 };
