/*
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 { __extends, __values } from "tslib";
import { Base, toNullable, Number_$type, fromEnum, typeCast, markType, getInstanceType } from "igniteui-angular-core";
import { ISupportSetProperty_$type } from "./ISupportSetProperty";
import { List$1 } from "igniteui-angular-core";
import { CT_GradientStop } from "./CT_GradientStop";
import { ST_GradientType_$type } from "./ST_GradientType";
import { XmlNamespaceDefinitionBase } from "./XmlNamespaceDefinitionBase";
import { CultureInfo } from "igniteui-angular-core";
import { parseNumber } from "igniteui-angular-core";
/**
 * @hidden
 */
var CT_GradientFill = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CT_GradientFill, _super);
    function CT_GradientFill() {
        var _this = _super.call(this) || this;
        _this.a = 0;
        _this.b = null;
        _this.m = toNullable(ST_GradientType_$type, null);
        _this.i = toNullable(Number_$type, null);
        _this.j = toNullable(Number_$type, null);
        _this.k = toNullable(Number_$type, null);
        _this.l = toNullable(Number_$type, null);
        _this.h = toNullable(Number_$type, null);
        _this.b = new List$1(CT_GradientStop.$, 0);
        return _this;
    }
    CT_GradientFill.o = function (a, b, c, d, e, f, g) {
        var e_1, _a;
        b = toNullable(ST_GradientType_$type, null);
        c = toNullable(Number_$type, null);
        d = toNullable(Number_$type, null);
        e = toNullable(Number_$type, null);
        f = toNullable(Number_$type, null);
        g = toNullable(Number_$type, null);
        try {
            for (var _b = __values(fromEnum(a.ab.u)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var h = _c.value;
                switch (h.a.e(a.d)) {
                    case "type":
                        b = toNullable(ST_GradientType_$type, XmlNamespaceDefinitionBase.b(ST_GradientType_$type, h.d));
                        break;
                    case "degree":
                        c = toNullable(Number_$type, parseNumber(h.d, CultureInfo.invariantCulture));
                        break;
                    case "left":
                        d = toNullable(Number_$type, parseNumber(h.d, CultureInfo.invariantCulture));
                        break;
                    case "right":
                        e = toNullable(Number_$type, parseNumber(h.d, CultureInfo.invariantCulture));
                        break;
                    case "top":
                        f = toNullable(Number_$type, parseNumber(h.d, CultureInfo.invariantCulture));
                        break;
                    case "bottom":
                        g = toNullable(Number_$type, parseNumber(h.d, CultureInfo.invariantCulture));
                        break;
                    default: break;
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        return {
            p1: b,
            p2: c,
            p3: d,
            p4: e,
            p5: f,
            p6: g
        };
    };
    CT_GradientFill.p = function (a, b, c, d, e, f, g, h) {
        if (c === void 0) {
            c = toNullable(Number_$type, null);
        }
        if (d === void 0) {
            d = toNullable(Number_$type, null);
        }
        if (e === void 0) {
            e = toNullable(Number_$type, null);
        }
        if (f === void 0) {
            f = toNullable(Number_$type, null);
        }
        if (g === void 0) {
            g = toNullable(Number_$type, null);
        }
        if (h === void 0) {
            h = toNullable(ST_GradientType_$type, null);
        }
        a.ad.p(b, null);
        var i = null;
        var j = null;
        if (c.hasValue) {
            j = "bottom";
            i = c.value.toString();
            a.ad.h(j, i);
        }
        if (d.hasValue) {
            j = "degree";
            i = d.value.toString();
            a.ad.h(j, i);
        }
        if (e.hasValue) {
            j = "left";
            i = e.value.toString();
            a.ad.h(j, i);
        }
        if (f.hasValue) {
            j = "right";
            i = f.value.toString();
            a.ad.h(j, i);
        }
        if (g.hasValue) {
            j = "top";
            i = g.value.toString();
            a.ad.h(j, i);
        }
        if (h.hasValue) {
            j = "type";
            i = XmlNamespaceDefinitionBase.p(ST_GradientType_$type, h.value);
            a.ad.h(j, i);
        }
    };
    CT_GradientFill.prototype.setProperty = function (a, b) {
        switch (a) {
            case 1599:
                this.b.add(typeCast(CT_GradientStop.$, b));
                break;
            default: break;
        }
    };
    CT_GradientFill.prototype.toString = function () {
        var a = getInstanceType(this);
        return a != null ? a.typeName : _super.prototype.toString.call(this);
    };
    CT_GradientFill.$t = markType(CT_GradientFill, 'CT_GradientFill', Base.$, [ISupportSetProperty_$type]);
    return CT_GradientFill;
}(Base));
export { CT_GradientFill };
