Пример #1
0
 /// <summary>
 /// メタデータを含むテキストデータを解析
 /// </summary>
 /// <param name="text">解析するテキスト</param>
 protected virtual void Parse()
 {
     try
     {
         //テキストを先頭から1文字づつ解析
         int max   = OriginalText.Length;
         int index = 0;
         while (index < max)
         {
             if (ParseEscapeSequence(index))
             {
                 //エスケープシーケンスの処理
                 index += 2;
             }
             else
             {
                 string tagName  = "";
                 string tagArg   = "";
                 int    endIndex = ParserUtil.ParseTag(OriginalText, index,
                                                       (name, arg) =>
                 {
                     bool ret = ParseTag(name, arg);
                     if (ret)
                     {
                         tagName = name;
                         tagArg  = arg;
                     }
                     return(ret);
                 });
                 if (index == endIndex)
                 {
                     //タグがなかった
                     //通常パターンのテキストを1文字追加
                     AddChar(OriginalText[index]);
                     ++index;
                 }
                 else
                 {
                     //タグデータを挿入
                     string tagString = OriginalText.Substring(index, endIndex - index + 1);
                     PoolList.Insert(0, MakeTag(tagString, tagName, tagArg));
                     index = endIndex + 1;
                 }
             }
             ParsedDataList.AddRange(PoolList);
             PoolList.Clear();
         }
         PoolList.Clear();
     }
     catch (System.Exception e)
     {
         AddErrorMsg(e.Message + e.StackTrace);
     }
 }
Пример #2
0
    public void ClearAll()
    {
        int    count = poolList.Count;
        object tempObj;

        for (int i = 0; i < count; i++)
        {
            tempObj = poolList.GetObjectBy(0);
            poolList.Remove(tempObj);
            DestroyObj(tempObj);
        }
        poolList.Clear();
        ActivatedCount = 0;
        NotActiveCount = 0;
    }