コード例 #1
0
ファイル: LineReader.cs プロジェクト: ywscr/markdig
        /// <summary>
        /// Initializes a new instance of the <see cref="LineReader"/> class.
        /// </summary>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="ArgumentOutOfRangeException">bufferSize cannot be &lt;= 0</exception>
        public LineReader(string text)
        {
            if (text is null)
            {
                ThrowHelper.ArgumentNullException_text();
            }

            _text          = text;
            SourcePosition = 0;
        }
コード例 #2
0
ファイル: StringLineGroup.cs プロジェクト: obarlik/markdig
 /// <summary>
 /// Initializes a new instance of the <see cref="StringLineGroup"/> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <exception cref="ArgumentNullException"></exception>
 public StringLineGroup(string text)
 {
     if (text == null)
     {
         ThrowHelper.ArgumentNullException_text();
     }
     Lines = new StringLine[1];
     Count = 0;
     Add(new StringSlice(text));
 }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StringSlice"/> struct.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        /// <exception cref="ArgumentNullException"></exception>
        public StringSlice(string text, int start, int end)
        {
            if (text is null)
            {
                ThrowHelper.ArgumentNullException_text();
            }

            Text  = text;
            Start = start;
            End   = end;
        }