Esempio n. 1
0
        /// <summary>
        /// 合并原有的表情(数据库有记录的) 和 现在目录底下的实际文件
        /// </summary>
        /// <param name="emoticons"></param>
        public void UniteEmotincos(DefaultEmoticonCollection emoticons)
        {
            DefaultEmoticonCollection diremoticons = new DefaultEmoticonCollection(this);

            List <DefaultEmoticon> Emoticons = new List <DefaultEmoticon>();

            foreach (FileInfo file in IOUtil.GetImagFiles(this.FilePath, SearchOption.TopDirectoryOnly))
            {
                if (file.Name.Equals(PreviewFileName, StringComparison.OrdinalIgnoreCase))
                {
                    continue;
                }

                DefaultEmoticon face = new DefaultEmoticon(this);
                face.FileName = file.Name;
                face.FileSize = file.Length;
                diremoticons.Add(face);
            }

            foreach (DefaultEmoticon em in emoticons)
            {
                if (diremoticons.ContainsKey(em.EmoticonID))
                {
                    DefaultEmoticon temp = diremoticons.GetValue(em.EmoticonID);
                    temp.Shortcut  = em.Shortcut;
                    temp.SortOrder = em.SortOrder;
                }
            }
            m_Emoticons = diremoticons;
            Reorder();
        }
Esempio n. 2
0
        internal string AllotShortcut(DefaultEmoticon emot)
        {
            string file = emot.FileName.Substring(0, emot.FileName.LastIndexOf('.'));

            if (string.IsNullOrEmpty(this.DirectoryName))
            {
                return(string.Format(Shortcutfix, file));
            }
            else
            {
                return(string.Format(Shortcutfix,
                                     string.Format(ShortFormat, this.GroupName, file)));
            }
        }