Пример #1
0
        public PathToken NextToken()
        {
            if (!HasNext())
            {
                throw new IndexOutOfRangeException();
            }

            if (this.nextToken == null)
            {
                this.nextToken = new PathToken(path, pathIndex + 1);
            }
            return(this.nextToken);
        }
Пример #2
0
        public PathToken AsPathToken()
        {
            if (this.token != null)
            {
                return(this.token);
            }

            lock (_lock)
            {
                if (this.token != null)
                {
                    return(this.token);
                }

                if (this.nodes.Count <= 0)
                {
                    throw new InvalidOperationException("The path node is empty");
                }

                this.token = new PathToken(this, 0);
                return(this.token);
            }
        }