Ejemplo n.º 1
0
        public override bool IncrementToken()
        {
            if (input.IncrementToken())
            {
                // capture state lazily - maybe no SinkFilter accepts this state
                AttributeSource.State state = null;
                for (System.Collections.IEnumerator it = sinks.GetEnumerator(); it.MoveNext();)
                {
                    SinkTokenStream sink = (SinkTokenStream)((System.WeakReference)it.Current).Target;
                    if (sink != null)
                    {
                        if (sink.Accept(this))
                        {
                            if (state == null)
                            {
                                state = this.CaptureState();
                            }
                            sink.AddState(state);
                        }
                    }
                }
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public override bool IncrementToken()
        {
            if (input.IncrementToken())
            {
                // capture state lazily - maybe no SinkFilter accepts this state
                AttributeSource.State state = null;
                foreach (WeakReference wr in sinks)
                {
                    SinkTokenStream sink = (SinkTokenStream)wr.Target;
                    if (sink != null)
                    {
                        if (sink.Accept(this))
                        {
                            if (state == null)
                            {
                                state = this.CaptureState();
                            }
                            sink.AddState(state);
                        }
                    }
                }
                return(true);
            }

            return(false);
        }