/*
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 { 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
 */
export class CT_GradientFill extends Base {
    constructor() {
        super();
        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);
    }
    static o(a, b, c, d, e, f, g) {
        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);
        for (let h of fromEnum(a.ab.u)) {
            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;
            }
        }
        return {
            p1: b,
            p2: c,
            p3: d,
            p4: e,
            p5: f,
            p6: g
        };
    }
    static p(a, b, 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), h = toNullable(ST_GradientType_$type, null)) {
        a.ad.p(b, null);
        let i = null;
        let 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.f(ST_GradientType_$type, h.value);
            a.ad.h(j, i);
        }
    }
    setProperty(a, b) {
        switch (a) {
            case 1599:
                this.b.add(typeCast(CT_GradientStop.$, b));
                break;
            default: break;
        }
    }
    toString() {
        let a = getInstanceType(this);
        return a != null ? a.typeName : super.toString();
    }
}
CT_GradientFill.$t = markType(CT_GradientFill, 'CT_GradientFill', Base.$, [ISupportSetProperty_$type]);
//# sourceMappingURL=CT_GradientFill.js.map