internal InCome(string name, double percent, ObservableValue <double> maxValue) : this() { this.name = name; this.percent = new SubjectValue <double>(percent); this.maxValue = maxValue; InitObservableData(new StreamingContext()); }
internal Output(string name, double percent, ObservableValue <double> maxValue, Action expend = null) : this() { this.name = name; this.percent = new SubjectValue <double>(percent); this.maxValue = maxValue; this.expend = expend; InitObservableData(new StreamingContext()); }
internal void InitObservableData(StreamingContext context) { popNum = Observable.CombineLatest(pops.Where(x => x.def.is_collect_tax).Select(x => x.num.obs), (IList <double> nums) => nums.Sum(y => (int)y)).ToOBSValue(); tax = Observable.CombineLatest(pops.Select(x => x.tax.value.obs), (IList <double> nums) => nums.Sum()).ToOBSValue(); adminExpendBase = Observable.CombineLatest(pops.Select(x => x.adminExpend.value.obs), (IList <double> nums) => nums.Sum()).ToOBSValue(); }
private void InitObservableData(StreamingContext context) { monthSurplus = Observable.CombineLatest(incomes.total.obs, outputs.total.obs, (i, o) => i - o).ToOBSValue(); }
private void InitObservableData(StreamingContext context) { this.currValue = Observable.CombineLatest(this.percent.obs, maxValue.obs, (p, m) => p * m / 100).ToOBSValue(); }
private void InitObservableData(StreamingContext context) { total = Observable.CombineLatest(Output.all.Select(x => x.currValue.obs), (IList <double> all) => all.Sum()).ToOBSValue(); }
private void InitObservableData(StreamingContext context) { expectMonthTaxValue = Observable.CombineLatest(reportPopNum.obs, reportTaxPercent.obs, (x, y) => x * 0.006 * y / 100) .ToOBSValue(); }