Пример #1
0
        public static SectionedText operator +(SectionedText thisText, IDrawableText other)
        {
            if (other is SectionedText)
            {
                var otherSectioned = (SectionedText)other;
                var arr            = new IDrawableText[thisText.Sections.Length + otherSectioned.Sections.Length];
                for (var i = 0; i < thisText.Sections.Length; i++)
                {
                    arr[i] = thisText.Sections[i];
                }
                for (var i = 0; i < otherSectioned.Sections.Length; i++)
                {
                    arr[i + thisText.Sections.Length] = otherSectioned.Sections[i];
                }
                return(new SectionedText(arr));
            }

            var arr2 = new IDrawableText[thisText.Sections.Length + 1];

            for (var i = 0; i < thisText.Sections.Length; i++)
            {
                arr2[i] = thisText.Sections[i];
            }
            arr2[arr2.Length - 1] = other;
            return(new SectionedText(arr2));
        }
Пример #2
0
 public void ThreadSafeSetLine(int index, IDrawableText text)
 {
     lock (linesLock)
     {
         if (index == lines.Count)
         {
             lines.Add(text);
         }
         else
         {
             lines[index] = text;
         }
     }
 }
Пример #3
0
        public static SectionedText operator +(PlainText thisText, IDrawableText other)
        {
            if (other is SectionedText)
            {
                var otherSectioned = (SectionedText)other;
                var arr            = new IDrawableText[otherSectioned.Sections.Length];
                arr[0] = thisText;
                for (var i = 0; i < otherSectioned.Sections.Length; i++)
                {
                    arr[i + 1] = otherSectioned.Sections[i];
                }
                return(new SectionedText(arr));
            }

            return(new SectionedText(thisText, other));
        }
Пример #4
0
 public static void DrawText(IDrawableText text)
 {
     foreach (DrawableTextObject dto in text.TextObjects)
         DrawText(dto);
 }
Пример #5
0
 public TextButton(IDrawableText text) : base(text.Text)
 {
     Text = text;
 }
Пример #6
0
 public TextButton(string text) : base(text)
 {
     Text = new ColorText(text, Color.White);
 }
Пример #7
0
 protected ColorOption(IDrawableText text) : base(text.Text)
 {
     DrawableText = text;
 }
Пример #8
0
 public ColorOption(IDrawableText text, Utils.EventHandler function = null,
                    Option[] subOptions = null, ColorOptGetter update = null) : base(text.Text, function, subOptions)
 {
     DrawableText = text;
     Updater      = update;
 }