예제 #1
0
파일: SMS.cs 프로젝트: ratsil/bethe.ingenie
        static public List <SMILE> FindSmiles(string sText, string sWorkFolder)
        {
            List <SMILE> aRetVal = new List <SMILE>();
            int          nPos    = 0;

            if (null == _ahSmilesBinds)
            {
                InitSmiles();
            }
            //if (null == _ahSmilesAnimationBinds)     // временно не актуально. сейчас на каждую даже одинаковую анимашку загружаем
            //    InitSmilesAnimations(sWorkFolder);
            foreach (string sSml in _ahSmilesBinds.Keys)
            {
                POSITION stPos;
                string   sTex     = sText.ToLower();
                string   sSm      = sSml.ToLower();
                int      nPosText = 0;
                while (-1 < (nPos = sTex.Substring(nPosText).IndexOf(sSm)))
                {
                    stPos = new POSITION(nPos + nPosText, sSml.Length);
                    aRetVal.Add(new SMILE(sSml, sWorkFolder, stPos));
                    nPosText = stPos.End;
                }
            }
            if (1 < aRetVal.Count)
            {
                aRetVal.Sort(delegate(SMILE a, SMILE b) { return(a.stPosition.Start - b.stPosition.Start); });
            }
            return(aRetVal);
        }
예제 #2
0
파일: SMS.cs 프로젝트: ratsil/bethe.ingenie
 public SMILE(string sSml, string sWorkFolder, POSITION stPos)
 {
     this.sWorkFolder = sWorkFolder;
     sText            = sSml;
     stPosition       = stPos;
     if (null == _ahSmilesBinds)
     {
         InitSmiles();
     }
     cAnimation = GetAnimation(sText, sWorkFolder);
 }
예제 #3
0
파일: SMS.cs 프로젝트: ratsil/bethe.ingenie
        static public POSITION IsSmilePersist(string sText)
        {
            POSITION stRetVal = POSITION.Empty;
            int      nPos     = -1;

            if (null == _ahSmilesBinds)
            {
                InitSmiles();
            }
            foreach (string sSml in _ahSmilesBinds.Keys)
            {
                nPos = sText.ToLower().IndexOf(sSml.ToLower());
                if (-1 < nPos)
                {
                    if (stRetVal.Start > nPos || POSITION.Empty == stRetVal)
                    {
                        stRetVal.Start  = nPos;
                        stRetVal.Length = sSml.Length;
                    }
                }
            }
            return(stRetVal);
        }
예제 #4
0
파일: SMS.cs 프로젝트: ratsil/bethe.ingenie
 static public List<SMILE> FindSmiles(string sText, string sWorkFolder)
 {
     List<SMILE> aRetVal = new List<SMILE>();
     int nPos = 0;
     if (null == _ahSmilesBinds)
         InitSmiles();
     //if (null == _ahSmilesAnimationBinds)     // временно не актуально. сейчас на каждую даже одинаковую анимашку загружаем 
     //    InitSmilesAnimations(sWorkFolder);
     foreach (string sSml in _ahSmilesBinds.Keys)
     {
         POSITION stPos;
         string sTex = sText.ToLower();
         string sSm = sSml.ToLower();
         int nPosText = 0;
         while (-1 < (nPos = sTex.Substring(nPosText).IndexOf(sSm)))
         {
             stPos = new POSITION(nPos + nPosText, sSml.Length);
             aRetVal.Add(new SMILE(sSml, sWorkFolder, stPos));
             nPosText = stPos.End;
         }
     }
     if (1 < aRetVal.Count)
         aRetVal.Sort(delegate(SMILE a, SMILE b) { return a.stPosition.Start - b.stPosition.Start; });
     return aRetVal;
 }
예제 #5
0
파일: SMS.cs 프로젝트: ratsil/bethe.ingenie
 public SMILE(string sSml, string sWorkFolder, POSITION stPos)
 {
     this.sWorkFolder = sWorkFolder;
     sText = sSml;
     stPosition = stPos;
     if (null == _ahSmilesBinds)
         InitSmiles();
     cAnimation = GetAnimation(sText, sWorkFolder);
 }