示例#1
0
        public void AppendRichText(string textContent, SortedArray <int, uint> imagePosition_imageID, Font font, Color color)
        {
            int length = this.Text.Length;

            if (imagePosition_imageID != null)
            {
                int        num2;
                string     text       = textContent;
                List <int> allKeyList = imagePosition_imageID.GetAllKeyList();
                for (num2 = allKeyList.Count - 1; num2 >= 0; num2--)
                {
                    text = text.Remove(allKeyList[num2], 1);
                }
                base.AppendText(text);
                for (num2 = 0; num2 < allKeyList.Count; num2++)
                {
                    int num3 = allKeyList[num2];
                    this.InsertImage(imagePosition_imageID[num3], length + num3);
                }
            }
            else
            {
                base.AppendText(textContent);
            }
            base.Select(length, textContent.Length);
            base.SelectionColor = color;
            if (font != null)
            {
                base.SelectionFont = font;
            }
        }
示例#2
0
        public void AppendRichText(string textContent, SortedArray <int, uint> imagePosition_imageID, Dictionary <int, Bitmap> foreignObjectAry, Font font, Color color)
        {
            int length = this.Text.Length;

            if (imagePosition_imageID != null)
            {
                int        index;
                string     text       = textContent;
                List <int> allKeyList = imagePosition_imageID.GetAllKeyList();
                List <int> list2      = new List <int>();
                list2.AddRange(allKeyList);
                foreach (int num2 in foreignObjectAry.Keys)
                {
                    list2.Add(num2);
                }
                list2.Sort();
                for (index = list2.Count - 1; index >= 0; index--)
                {
                    text = text.Remove(list2[index], 1);
                }
                base.AppendText(text);
                for (index = 0; index < list2.Count; index++)
                {
                    int item = list2[index];
                    if (allKeyList.Contains(item))
                    {
                        this.InsertImage(imagePosition_imageID[item], length + item);
                    }
                    else
                    {
                        this.InsertImage(foreignObjectAry[item], length + item);
                    }
                }
            }
            else
            {
                base.AppendText(textContent);
            }
            base.Select(length, textContent.Length);
            base.SelectionColor = color;
            if (font != null)
            {
                base.SelectionFont = font;
            }
        }