/*
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 { DependencyObject } from "igniteui-angular-core";
import { INotifyPropertyChanged_$type, PropertyChangedEventArgs, runOn, delegateCombine, fromEnum, delegateRemove, markType } from "igniteui-angular-core";
import { BrushCollection } from "igniteui-angular-core";
import { Series } from "./Series";
import { List$1 } from "igniteui-angular-core";
import { PropertyUpdatedEventArgs } from "igniteui-angular-core";
import { BrushCollectionUtil } from "igniteui-angular-core";
/**
 * @hidden
 */
export class BrushScale extends DependencyObject {
    constructor() {
        super();
        this.j = null;
        this.o = null;
        this.propertyChanged = null;
        this.propertyUpdated = null;
        this.o = new List$1(Series.$, 0);
        this.brushes = new BrushCollection();
        let a = this.brushes;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.p));
        this.propertyUpdated = delegateCombine(this.propertyUpdated, (b, c) => this.q(b, c.propertyName, c.oldValue, c.newValue));
    }
    p(a, b) {
        for (let c of fromEnum(this.o)) {
            c.jd(false);
            c.id();
            c.ik();
        }
    }
    get brushes() {
        return this.j;
    }
    set brushes(a) {
        let b = this.j;
        if (this.j != null) {
            let c = this.j;
            c.collectionChanged = delegateRemove(c.collectionChanged, runOn(this, this.p));
        }
        this.j = a;
        if (this.j != null) {
            let d = this.j;
            d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.p));
        }
        for (let e of fromEnum(this.o)) {
            e.jd(false);
            e.id();
            e.ik();
        }
    }
    registerSeries(a) {
        let b = this.o.contains(a);
        if (!b) {
            this.o.add(a);
        }
    }
    unregisterSeries(a) {
        let b = this.o.contains(a);
        if (b) {
            this.o.remove(a);
        }
    }
    getBrush(a) {
        if (this.brushes == null || a < 0 || a >= this.brushes.count) {
            return null;
        }
        return this.brushes.item(a);
    }
    get_isReady() {
        return true;
    }
    get isReady() {
        return this.get_isReady();
    }
    v(a) {
        if (this.brushes == null || this.brushes.count == 0 || a < 0) {
            return null;
        }
        return BrushCollectionUtil.b(this.brushes, a);
    }
    r(a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        if (this.propertyUpdated != null) {
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
        }
    }
    q(a, b, c, d) {
        for (let e of fromEnum(this.o)) {
            e.jd(false);
            e.id();
            e.ik();
        }
    }
    get_isBrushScale() {
        return true;
    }
    get isBrushScale() {
        return this.get_isBrushScale();
    }
}
BrushScale.$t = markType(BrushScale, 'BrushScale', DependencyObject.$, [INotifyPropertyChanged_$type]);
//# sourceMappingURL=BrushScale.js.map