示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
        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();
        }
示例#4
0
 private void InitObservableData(StreamingContext context)
 {
     monthSurplus = Observable.CombineLatest(incomes.total.obs, outputs.total.obs, (i, o) => i - o).ToOBSValue();
 }
示例#5
0
 private void InitObservableData(StreamingContext context)
 {
     this.currValue = Observable.CombineLatest(this.percent.obs, maxValue.obs, (p, m) => p * m / 100).ToOBSValue();
 }
示例#6
0
 private void InitObservableData(StreamingContext context)
 {
     total = Observable.CombineLatest(Output.all.Select(x => x.currValue.obs), (IList <double> all) => all.Sum()).ToOBSValue();
 }
示例#7
0
 private void InitObservableData(StreamingContext context)
 {
     expectMonthTaxValue = Observable.CombineLatest(reportPopNum.obs, reportTaxPercent.obs,
                                                    (x, y) => x * 0.006 * y / 100)
                           .ToOBSValue();
 }