示例#1
0
		/// <summary>
		/// Starts a block.
		/// </summary>
		/// <param name="blockType">Type of the block.</param>
		/// <returns>The disposable used to end the block.</returns>
		public IDisposable StartBlock(BlockType? blockType = null, string name = null)
		{
			EnsureNotTerminated();

			_blockStack.Push(new BlockBuilder() { Type = blockType.GetValueOrDefault(BlockType.Text), Name = name });

			return new DisposableAction(EndBlock);
		}