/*
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 { CT_Address } from "./CT_Address";
import { ST_EntityType_$type } from "./ST_EntityType";
import { CultureInfo } from "igniteui-angular-core";
import { XmlNamespaceDefinitionBase } from "./XmlNamespaceDefinitionBase";
import { parseNumber } from "igniteui-angular-core";
/**
 * @hidden
 */
export class CT_GeoLocation extends Base {
    constructor() {
        super();
        this.b = null;
        this.f = toNullable(Number_$type, null);
        this.h = toNullable(Number_$type, null);
        this.j = null;
        this.d = 0;
    }
    get a() {
        return this.b;
    }
    set a(a) {
        this.b = a;
    }
    get e() {
        return this.f;
    }
    set e(a) {
        this.f = a;
    }
    get g() {
        return this.h;
    }
    set g(a) {
        this.h = a;
    }
    get i() {
        return this.j;
    }
    set i(a) {
        this.j = a;
    }
    get c() {
        return this.d;
    }
    set c(a) {
        this.d = a;
    }
    static l(a, b, c, d, e) {
        b = toNullable(Number_$type, null);
        c = toNullable(Number_$type, null);
        d = null;
        e = 0;
        for (let f of fromEnum(a.ab.u)) {
            switch (f.a.e(a.d)) {
                case "latitude":
                    b = toNullable(Number_$type, parseNumber(f.d, CultureInfo.invariantCulture));
                    break;
                case "longitude":
                    c = toNullable(Number_$type, parseNumber(f.d, CultureInfo.invariantCulture));
                    break;
                case "entityName":
                    d = f.d;
                    break;
                case "entityType":
                    e = XmlNamespaceDefinitionBase.b(ST_EntityType_$type, f.d);
                    break;
                default: break;
            }
        }
        ;
        return {
            p1: b,
            p2: c,
            p3: d,
            p4: e
        };
    }
    static m(a, b, c, d, e, f) {
        a.ad.p(b, "cx");
        let g = null;
        let h = null;
        if (c.hasValue) {
            h = "latitude";
            g = c.value.toString();
            a.ad.h(h, g);
        }
        if (d.hasValue) {
            h = "longitude";
            g = d.value.toString();
            a.ad.h(h, g);
        }
        if (e != null) {
            h = "entityName";
            g = e;
            a.ad.h(h, g);
        }
        h = "entityType";
        g = XmlNamespaceDefinitionBase.f(ST_EntityType_$type, f);
        a.ad.h(h, g);
        ;
    }
    setProperty(a, b) {
        switch (a) {
            case 18:
                this.a = typeCast(CT_Address.$, b);
                break;
            default: break;
        }
    }
    toString() {
        let a = getInstanceType(this);
        return a != null ? a.typeName : super.toString();
    }
}
CT_GeoLocation.$t = markType(CT_GeoLocation, 'CT_GeoLocation', Base.$, [ISupportSetProperty_$type]);
//# sourceMappingURL=CT_GeoLocation.js.map