internal SafeSeekableNavigator(SeekableXPathNavigator navigator, int nodeCountMax)
 {
     this.navigator = navigator;
     this.counter = this;
     this.nodeCount = nodeCountMax;
     this.nodeCountMax = nodeCountMax;
 }
Пример #2
0
 internal SafeSeekableNavigator(SeekableXPathNavigator navigator, int nodeCountMax)
 {
     this.navigator    = navigator;
     this.counter      = this;
     this.nodeCount    = nodeCountMax;
     this.nodeCountMax = nodeCountMax;
 }
Пример #3
0
        /// <summary>
        /// Evaluates the filter over infosets surfaced via the given navigator by using the Fx engine
        /// We assume that the filter was pre-compiled using the framework engine
        /// </summary>
        internal bool MatchFx(XPathNavigator navigator)
        {
            INodeCounter counter = navigator as INodeCounter;

            if (counter == null)
            {
                navigator = new SafeSeekableNavigator(new GenericSeekableNavigator(navigator), this.NodeQuota);
            }
            else
            {
                counter.CounterMarker = this.NodeQuota;
                counter.MaxCounter    = this.NodeQuota;
            }
            Fx.Assert(null != this.query && OpcodeID.MatchSingleFx == this.query.ID, "");
            try
            {
                return(((MatchSingleFxEngineResultOpcode)this.query).Match(navigator));
            }
            catch (XPathNavigatorException e)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(e.Process(this.query));
            }
            catch (NavigatorInvalidBodyAccessException e)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(e.Process(this.query));
            }
        }
        internal bool MatchFx(XPathNavigator navigator)
        {
            bool         flag;
            INodeCounter counter = navigator as INodeCounter;

            if (counter == null)
            {
                navigator = new SafeSeekableNavigator(new GenericSeekableNavigator(navigator), base.NodeQuota);
            }
            else
            {
                counter.CounterMarker = base.NodeQuota;
                counter.MaxCounter    = base.NodeQuota;
            }
            try
            {
                flag = ((MatchSingleFxEngineResultOpcode)base.query).Match(navigator);
            }
            catch (XPathNavigatorException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(exception.Process(base.query));
            }
            catch (NavigatorInvalidBodyAccessException exception2)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(exception2.Process(base.query));
            }
            return(flag);
        }
Пример #5
0
        public override bool IsSamePosition(XPathNavigator other)
        {
            if (other == null)
            {
                return(false);
            }
            SafeSeekableNavigator navigator = other as SafeSeekableNavigator;

            return((navigator != null) && this.navigator.IsSamePosition(navigator.navigator));
        }
Пример #6
0
        public override bool IsDescendant(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return(false);
            }
            SafeSeekableNavigator navigator2 = navigator as SafeSeekableNavigator;

            return((navigator2 != null) && this.navigator.IsDescendant(navigator2.navigator));
        }
Пример #7
0
        public override bool MoveTo(XPathNavigator other)
        {
            if (other == null)
            {
                return(false);
            }
            this.IncrementNodeCount();
            SafeSeekableNavigator navigator = other as SafeSeekableNavigator;

            return((navigator != null) && this.navigator.MoveTo(navigator.navigator));
        }
Пример #8
0
 public override XmlNodeOrder ComparePosition(XPathNavigator navigator)
 {
     if (navigator != null)
     {
         SafeSeekableNavigator navigator2 = navigator as SafeSeekableNavigator;
         if (navigator2 != null)
         {
             return(this.navigator.ComparePosition(navigator2.navigator));
         }
     }
     return(XmlNodeOrder.Unknown);
 }
        internal SeekableXPathNavigator CreateSafeNavigator(SeekableXPathNavigator navigator)
        {
            INodeCounter counter = navigator as INodeCounter;

            if (counter != null)
            {
                counter.CounterMarker = this.maxNodes;
                counter.MaxCounter    = this.maxNodes;
                return(navigator);
            }
            navigator = new SafeSeekableNavigator(navigator, this.maxNodes);
            return(navigator);
        }
 internal virtual void Init(SeekableXPathNavigator navigator, int nodeCountMax)
 {
     this.navigator = navigator;
     this.nodeCount = nodeCountMax;
     this.counter = this;
 }
 internal SafeSeekableNavigator(SafeSeekableNavigator nav)
 {
     this.navigator = (SeekableXPathNavigator)nav.navigator.Clone();
     this.counter = nav.counter;
 }
Пример #12
0
 internal SafeSeekableNavigator(SafeSeekableNavigator nav)
 {
     this.navigator = (SeekableXPathNavigator)nav.navigator.Clone();
     this.counter   = nav.counter;
 }
 internal bool MatchFx(XPathNavigator navigator)
 {
     bool flag;
     INodeCounter counter = navigator as INodeCounter;
     if (counter == null)
     {
         navigator = new SafeSeekableNavigator(new GenericSeekableNavigator(navigator), base.NodeQuota);
     }
     else
     {
         counter.CounterMarker = base.NodeQuota;
         counter.MaxCounter = base.NodeQuota;
     }
     try
     {
         flag = ((MatchSingleFxEngineResultOpcode) base.query).Match(navigator);
     }
     catch (XPathNavigatorException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(exception.Process(base.query));
     }
     catch (NavigatorInvalidBodyAccessException exception2)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(exception2.Process(base.query));
     }
     return flag;
 }
Пример #14
0
 internal virtual void Init(SeekableXPathNavigator navigator, int nodeCountMax)
 {
     this.navigator = navigator;
     this.nodeCount = nodeCountMax;
     this.counter   = this;
 }