Esempio n. 1
0
            protected override CalcExpression VisitNameExpression(CalcNameExpression expr, int baseRow, int baseColumn)
            {
                if (CultureInfo.InvariantCulture.CompareInfo.Compare(expr.Name, this._name, CompareOptions.IgnoreCase) == 0)
                {
                    throw new ArgumentException();
                }
                CalcEvaluator.ValidateNameVisitor visitor = new CalcEvaluator.ValidateNameVisitor(this._context, this._name);
                CalcExpression name = this._context.GetName(expr.Name);

                if (name == null)
                {
                    throw new ArgumentException();
                }
                visitor.Visit(name, baseRow, baseColumn);
                return(base.VisitNameExpression(expr, baseRow, baseColumn));
            }
Esempio n. 2
0
            protected override CalcExpression VisitExternalNameExpression(CalcExternalNameExpression expr, int baseRow, int baseColumn)
            {
                if ((expr.Source == this._context.Source) && (CultureInfo.InvariantCulture.CompareInfo.Compare(expr.Name, this._name, CompareOptions.IgnoreCase) == 0))
                {
                    throw new ArgumentException();
                }
                CalcEvaluator.ValidateNameVisitor visitor = new CalcEvaluator.ValidateNameVisitor(this._context, this._name);
                CalcExpression name = expr.Source.GetEvaluatorContext(new CalcCellIdentity(this._context.Row, this._context.Column)).GetName(expr.Name);

                if (name == null)
                {
                    throw new ArgumentException();
                }
                visitor.Visit(name, baseRow, baseColumn);
                return(base.VisitExternalNameExpression(expr, baseRow, baseColumn));
            }