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; }
private void Push(MongoContainerType containerType) { UpdateIndex(); _positionsStack.Push(_currentPosition); _currentPosition = new MongoPosition(containerType); // TODO: check for max depth exceeded }
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); } }
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 }