Exemple #1
0
 /// <summary>
 /// Writes the line.
 /// </summary>
 /// <param name="line">The line.</param>
 public void WriteLine(StringPart line)
 {
     //var t = text[text.Count - 1];
     //text.RemoveAt(text.Count - 1);
     //t.Batch.Clear();
     //t.Batch.Write(line);
     //t.Height = t.Batch.CalculateArea(Int2D.Zero, Justification, Area.Width).Height;
     //text.Insert(0, t);
     Write(line.ToString());
     moveNextDrawToNewLine = true;
 }
Exemple #2
0
        /// <summary>
        /// Appends text onto the last line written.
        /// </summary>
        /// <param name="text">The text to append.</param>
        public void Write(StringPart line)
        {
            if (moveNextDrawToNewLine || text.Count == 0)
            {
                text.Add(line);
                moveNextDrawToNewLine = false;
            }
            else
            {
                var current = text[text.Count - 1];
                text[text.Count - 1] = current.ToString() + line.ToString();
            }

            //if (line[line.Length - 1] == '\n')
            //    moveNextDrawToNewLine = true;

            text.RemoveRange(0, Math.Max(0, text.Count - historyCapacity));

            if (startIndex == text.Count - 1)
            {
                ScrollToNewest();
            }
        }