Example #1
0
        private void BeginNewObject()
        {
            if (_stateMachine.Current != Kv1TextReaderState.InObjectBetweenKeyAndValue)
            {
                throw new InvalidOperationException();
            }

            _listener.OnObjectStart(_stateMachine.CurrentName);

            _stateMachine.PushObject();
            _stateMachine.Push(Kv1TextReaderState.InObjectBeforeKey);
        }
Example #2
0
        void BeginNewObject()
        {
            if (stateMachine.Current != KV1TextReaderState.InObjectBetweenKeyAndValue)
            {
                throw new InvalidOperationException($"Attempted to begin new object while in state {stateMachine.Current}.");
            }

            listener.OnObjectStart(stateMachine.CurrentName);

            stateMachine.PushObject();
            stateMachine.Push(KV1TextReaderState.InObjectBeforeKey);
        }