Exemplo n.º 1
0
        public void ConcatTest()
        {
            var textModel = new RichTextModel();

            textModel.SetHighlighting(0, 5, new HighlightingColor {
                Name = "text1"
            });
            var text1 = new RichText("text1", textModel);

            var textModel2 = new RichTextModel();

            textModel2.SetHighlighting(0, 5, new HighlightingColor {
                Name = "text2"
            });
            var text2 = new RichText("text2", textModel2);

            RichText text3 = RichText.Concat(text1, RichText.Empty, text2);

            Assert.AreEqual(text1.GetHighlightingAt(0), text3.GetHighlightingAt(0));
            Assert.AreNotEqual(text1.GetHighlightingAt(0), text3.GetHighlightingAt(5));
            Assert.AreEqual(text2.GetHighlightingAt(0), text3.GetHighlightingAt(5));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Concatenates the specified rich texts.
 /// </summary>
 public static RichText operator +(RichText a, RichText b)
 {
     return(RichText.Concat(a, b));
 }