/// <summary>
        /// Creates a <see cref="ProxyJsonBlock"/>.
        /// </summary>
        /// <param name="blockProcessor">The <see cref="BlockProcessor"/> processing the <see cref="ProxyJsonBlock"/>.</param>
        /// <param name="blockParser">The <see cref="BlockParser"/> parsing the <see cref="ProxyJsonBlock"/>.</param>
        public ProxyJsonBlock CreateProxyJsonBlock(BlockProcessor blockProcessor, BlockParser blockParser)
        {
            if (blockProcessor == null)
            {
                throw new ArgumentNullException(nameof(blockProcessor));
            }

            return(new ProxyJsonBlock(typeof(TBlock).Name, blockParser) // TODO nameof(TBlock) test
            {
                Column = blockProcessor.Column,
                Span = { Start = blockProcessor.Start } // JsonBlockParser.ParseLine will update the span's end
                // Line is assigned by BlockProcessor
            });
        }
Beispiel #2
0
 /// <summary>
 /// Creates a <see cref="ProxyLeafBlock"/>.
 /// </summary>
 /// <param name="mainTypeName">Type name of the <see cref="LeafBlock"/> this <see cref="ProxyLeafBlock"/> is proxying for.</param>
 /// <param name="blockParser">The <see cref="BlockParser"/> parsing the <see cref="LeafBlock"/>.</param>
 public ProxyLeafBlock(string mainTypeName, BlockParser blockParser) : base(blockParser)
 {
     MainTypeName = mainTypeName;
 }
 /// <summary>
 /// Creates a <see cref="PlainLeafBlock"/>.
 /// </summary>
 /// <param name="parser">The <see cref="BlockParser"/> parsing the <see cref="PlainLeafBlock"/>.</param>
 public PlainLeafBlock(BlockParser parser) : base(parser)
 {
     ProcessInlines = true;
 }
 /// <summary>
 /// Creates a <see cref="ProxyFencedLeafBlock"/>.
 /// </summary>
 /// <param name="openingFenceIndent">The indent of the opening fence.</param>
 /// <param name="openingFenceCharCount">The number of characters in the opening fence.</param>
 /// <param name="mainTypeName">Type name of the fenced <see cref="LeafBlock"/> the <see cref="ProxyFencedLeafBlock"/> is proxying for.</param>
 /// <param name="blockParser">The <see cref="BlockParser"/> parsing the <see cref="ProxyFencedLeafBlock"/>.</param>
 public ProxyFencedLeafBlock(int openingFenceIndent, int openingFenceCharCount, string mainTypeName, BlockParser blockParser) : base(mainTypeName, blockParser)
 {
     OpeningFenceIndent    = openingFenceIndent;
     OpeningFenceCharCount = openingFenceCharCount;
     IsBreakable           = false; // Fenced blocks aren't breakable. They only close when we reach a closing fence or if an ancestor closes.
 }
 /// <inheritdoc />
 public abstract T Create(BlockProcessor blockProcessor, BlockParser blockParser);
 /// <summary>
 /// Creates a <see cref="ProxyJsonBlock"/>.
 /// </summary>
 /// <param name="mainTypeName">Type name of the JSON <see cref="LeafBlock"/> this <see cref="ProxyJsonBlock"/> is proxying for.</param>
 /// <param name="blockParser">The <see cref="BlockParser"/> parsing the JSON <see cref="LeafBlock"/>.</param>
 public ProxyJsonBlock(string mainTypeName, BlockParser blockParser) : base(mainTypeName, blockParser)
 {
 }
Beispiel #7
0
 /// <summary>
 /// Creates a <see cref="ProxyContainerBlock"/>.
 /// </summary>
 /// <param name="mainTypeName">Type name of the <see cref="ContainerBlock"/> this <see cref="ProxyContainerBlock"/> is proxying for.</param>
 /// <param name="blockParser">The <see cref="BlockParser"/> parsing the <see cref="ContainerBlock"/>.</param>
 public ProxyContainerBlock(string mainTypeName, BlockParser blockParser) : base(blockParser)
 {
     MainTypeName = mainTypeName;
 }
 /// <summary>
 /// Creates a <see cref="PlainContainerBlock"/>.
 /// </summary>
 /// <param name="parser">The <see cref="BlockParser"/> parsing the <see cref="PlainContainerBlock"/>.</param>
 public PlainContainerBlock(BlockParser parser) : base(parser)
 {
 }
Beispiel #9
0
 /// <inheritdoc />
 public abstract TProxy CreateProxyFencedBlock(int openingFenceIndent, int openingFenceCharCount, BlockProcessor blockProcessor, BlockParser blockParser);