Esempio n. 1
0
 public MongoPosition(MongoContainerType containerType)
 {
     ContainerType = containerType;
     HasIndex      = containerType.HasIndex();
     Position      = -1;
     PropertyName  = null;
 }
 public MongoPosition(MongoContainerType containerType)
 {
     ContainerType = containerType;
     HasIndex = containerType.HasIndex();
     Position = -1;
     PropertyName = null;
 }
Esempio n. 3
0
        private void Push(MongoContainerType containerType)
        {
            UpdateIndex();

            _positionsStack.Push(_currentPosition);
            _currentPosition = new MongoPosition(containerType);

            // TODO: check for max depth exceeded
        }
Esempio n. 4
0
        private void ValidateEndToken(Newtonsoft.Json.JsonToken tokenType, MongoContainerType expectedContainerType)
        {
            var poppedContainerType = Pop();

            if (poppedContainerType != expectedContainerType)
            {
                var message = string.Format(
                    "JsonToken {0} is not valid for closing JsonType {1}.", tokenType, poppedContainerType);
                throw new Newtonsoft.Json.JsonReaderException(message);
            }
        }
Esempio n. 5
0
 public static bool HasIndex(this MongoContainerType containerType)
 {
     return(containerType == MongoContainerType.Array || containerType == MongoContainerType.Constructor);
 }
        private void ValidateEndToken(Newtonsoft.Json.JsonToken tokenType, MongoContainerType expectedContainerType)
        {
            var poppedContainerType = Pop();

            if (poppedContainerType != expectedContainerType)
            {
                var message = string.Format(
                    "JsonToken {0} is not valid for closing JsonType {1}.", tokenType, poppedContainerType);
                throw new Newtonsoft.Json.JsonReaderException(message);
            }
        }
        private void Push(MongoContainerType containerType)
        {
            UpdateIndex();

            _positionsStack.Push(_currentPosition);
            _currentPosition = new MongoPosition(containerType);

            // TODO: check for max depth exceeded
        }