示例#1
0
 public void Add(ref StringLine line)
 {
     if (Count == Lines.Length)
     {
         IncreaseCapacity();
     }
     Lines[Count++] = line;
 }
示例#2
0
 public void Add(StringSlice slice)
 {
     if (Count == Lines.Length)
     {
         IncreaseCapacity();
     }
     Lines[Count++] = new StringLine(ref slice);
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StringLineGroup"/> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <exception cref="System.ArgumentNullException"></exception>
 public StringLineGroup(string text)
 {
     if (text == null)
     {
         throw new ArgumentNullException(nameof(text));
     }
     Lines = new StringLine[1];
     Count = 0;
     Add(new StringSlice(text));
 }
示例#4
0
 /// <summary>
 /// Removes the line at the specified index.
 /// </summary>
 /// <param name="index">The index.</param>
 public void RemoveAt(int index)
 {
     if (Count - 1 == index)
     {
         Count--;
     }
     else
     {
         Array.Copy(Lines, index + 1, Lines, index, Count - index - 1);
         Lines[Count - 1] = new StringLine();
         Count--;
     }
 }