예제 #1
0
        /// <summary>
        /// 获取Box中的所有内容。
        /// </summary>
        /// <param name="containsForeignObject">内容中是否包含不是由IImagePathGetter管理的图片对象</param>
        /// <returns>key为位置,val为图片的ID</returns>
        public ChatBoxContent GetContent()
        {
            ChatBoxContent  content = new ChatBoxContent(this.Text, this.Font, this.ForeColor);
            List <REOBJECT> list    = this.RichEditOle.GetAllREOBJECT();

            for (int i = 0; i < list.Count; i++)
            {
                uint pos = (uint)list[i].posistion;
                content.PicturePositions.Add(pos);
                if (list[i].dwUser != 10000)
                {
                    //content.AddEmotion(pos, list[i].dwUser);
                    content.AddForeignImage(pos, this.defaultEmotionDictionary[list[i].dwUser]);
                }
                else
                {
                    GifBox box = (GifBox)Marshal.GetObjectForIUnknown(list[i].poleobj);
                    content.AddForeignImage(pos, box.Image);
                }
            }

            return(content);
        }
예제 #2
0
        /// <summary>
        /// 获取Box中的所有内容。
        /// </summary>
        /// <param name="containsForeignObject">内容中是否包含不是由IImagePathGetter管理的图片对象</param>
        /// <returns>key为位置,val为图片的ID</returns>
        public ChatBoxContent GetContent()
        {
            var content = new ChatBoxContent(this.Text, this.Font, this.ForeColor);
            var list    = this.RichEditOle.GetAllREOBJECT();

            for (var i = 0; i < list.Count; i++)
            {
                var pos = (uint)list[i].posistion;
                content.PicturePositions.Add(pos);
                if (list[i].dwUser != 10000)
                {
                    content.AddEmotion(pos, list[i].dwUser);
                }
                else
                {
                    var box = (GifBox)Marshal.GetObjectForIUnknown(list[i].poleobj);
                    content.AddForeignImage(pos, box.Image);
                }
            }

            return(content);
        }