Example #1
0
        // Just recalc Name.
        private void RecalcWorker2(string name)
        {
            if (_calcs.ContainsKey(name))
            {
                return; // already computed.
            }

            var fi = _parent.Formulas[name];

            // Now calculate this node. Will recalc any dependencies if needed.
            if (fi._binding != null)
            {
                var binding = fi._binding;

                (IntermediateNode irnode, ScopeSymbol ruleScopeSymbol) = IRTranslator.Translate(binding);

                var scope = this;
                var v     = new EvalVisitor(_cultureInfo);

                FormulaValue newValue = irnode.Accept(v, SymbolContext.New());

                var equal = fi._value != null &&  // null on initial run.
                            RuntimeHelpers.AreEqual(newValue, fi._value);

                if (!equal)
                {
                    _sendUpdates.Add(name);
                }

                fi._value = newValue;
            }

            _calcs[name] = fi._value;
        }