Esempio n. 1
0
        private Csw.V202.XPathQueryableNavigator GetNavigator(ExpressionBuilderParameters parameters)
        {
            if (_Navigator == null)
            {
                Csw.V202.XPathQueryableNavigator xptn = new Csw.V202.XPathQueryableNavigator(parameters.ElementType);
                XPathNodeIterator xpni = xptn.Select(_Identifier.Symbol, parameters.NamespaceResolver, true);
                while (xpni.MoveNext())
                {
                    _Navigator = xpni.Current as Csw.V202.XPathQueryableNavigator;
                }

                Debug.Assert(_Navigator != null);
                if (_Navigator == null)
                {
                    throw new InvalidOperationException(
                              string.Format(
                                  CultureInfo.CurrentCulture,
                                  SR.InvalidPropertyNameExpressionException,
                                  _Identifier.Symbol
                                  )
                              );
                }
            }

            return(_Navigator);
        }
Esempio n. 2
0
        public Expression CreateExpression(ExpressionBuilderParameters parameters, Type expectedStaticType, Func<Expression, ParameterExpression, Expression> operatorCreator)
        {
            if (!_Result.HasValue)
            {
                Csw.V202.XPathQueryableNavigator xptn=new Csw.V202.XPathQueryableNavigator(parameters.ElementType);
                XPathNodeIterator xpni=xptn.Select(_AttributeName.Identifier.Symbol, parameters.NamespaceResolver, true);
                _Result=xpni.MoveNext();
                if (_Negated)
                    _Result=!_Result;
            }

            return Expression.Constant(_Result.Value, typeof(bool));
        }
Esempio n. 3
0
        public Expression CreateExpression(ExpressionBuilderParameters parameters, Type expectedStaticType, Func <Expression, ParameterExpression, Expression> operatorCreator)
        {
            if (!_Result.HasValue)
            {
                Csw.V202.XPathQueryableNavigator xptn = new Csw.V202.XPathQueryableNavigator(parameters.ElementType);
                XPathNodeIterator xpni = xptn.Select(_AttributeName.Identifier.Symbol, parameters.NamespaceResolver, true);
                _Result = xpni.MoveNext();
                if (_Negated)
                {
                    _Result = !_Result;
                }
            }

            return(Expression.Constant(_Result.Value, typeof(bool)));
        }
Esempio n. 4
0
        private Csw.V202.XPathQueryableNavigator GetNavigator(ExpressionBuilderParameters parameters)
        {
            if (_Navigator==null)
            {
                Csw.V202.XPathQueryableNavigator xptn=new Csw.V202.XPathQueryableNavigator(parameters.ElementType);
                XPathNodeIterator xpni=xptn.Select(_Identifier.Symbol, parameters.NamespaceResolver, true);
                while (xpni.MoveNext())
                    _Navigator=xpni.Current as Csw.V202.XPathQueryableNavigator;

                Debug.Assert(_Navigator!=null);
                if (_Navigator==null)
                    throw new InvalidOperationException(
                        string.Format(
                            CultureInfo.CurrentCulture,
                            SR.InvalidPropertyNameExpressionException,
                            _Identifier.Symbol
                        )
                    );
            }

            return _Navigator;
        }