[This is preliminary documentation and is subject to change.]
Ensures that the current event is of the specified type, returns it and moves to the next event.
| C# | Visual Basic | Visual C++ |
public T Expect<T>() where T : ParsingEvent
Public Function Expect(Of T As ParsingEvent) As T
public: generic<typename T> where T : ParsingEvent T Expect()
- T
- Type of the ParsingEvent.
Returns the current event.
| Exception | Condition |
|---|---|
| YamlException | If the current event is not of the specified type. |