Пример #1
0
        public static RichText operator +(RichText rt, string s)
        {
            RichTextSection[] sections = new RichTextSection[rt.Sections.Count + 1];
            int i = 0;

            foreach (RichTextSection section in rt.Sections)
            {
                sections[i++] = section;
            }
            sections[i++] = new RichTextSection(s, Color.White);
            return(new RichText(sections));
        }
Пример #2
0
 /// <summary>
 /// Writes to the current line
 /// </summary>
 /// <param name="rts">string to write</param>
 public void Write(RichTextSection rts)
 {
     lock (_linesModifyLock)
     {
         if (Lines.Length != 0)
         {
             Lines[Lines.Length - 1].Sections.Add(rts);
         }
         else
         {
             WriteLine(new RichText(rts));
         }
     }
 }
Пример #3
0
        public static RichText operator +(RichText rt1, RichText rt2)
        {
            RichTextSection[] sections = new RichTextSection[rt1.Sections.Count + rt2.Sections.Count];
            int i = 0;

            foreach (RichTextSection section in rt1.Sections)
            {
                sections[i++] = section;
            }
            foreach (RichTextSection section in rt2.Sections)
            {
                sections[i++] = section;
            }
            return(new RichText(sections));
        }