Example #1
0
        public bool MoveToFirstChild(string nameFilter = null)
        {
            ScopedNavigator me = null;

            if (this.AtResource)
            {
                me = (ScopedNavigator)this.Clone();

                // Is the current position not a contained resource?
                if (Parent?.ContainedResources().FirstOrDefault() == null)
                {
                    ResourceContext = _wrapped.Clone();
                }
            }

            if (!_wrapped.MoveToFirstChild(nameFilter))
            {
                return(false);
            }

            // If the current position is a resource, we'll be the new _parentScope
            if (me != null)
            {
                Parent = me;
            }

            _cache = new Cache();

            return(true);
        }