コード例 #1
0
 /// <summary>
 /// 添加数据
 /// </summary>
 /// <param name="data">更新数据</param>
 internal void Add(SearchData data)
 {
     do
     {
         try
         {
             do
             {
                 if (data.IsRemove)
                 {
                     if (searcher.getRemoveText(data))
                     {
                         getRemoveResult(data.Text);
                         searcher.remove(ref data.Key, removeResult);
                     }
                 }
                 else
                 {
                     getResult(data.Text);
                     if (result.Count != 0)
                     {
                         searcher.add(ref data.Key, data.Text, result);
                         indexArrays.Add(result.Values, value => value.Indexs.Array);
                     }
                 }
             }while (searcher.isDisposed == 0 && (data = data.LinkNext) != null);
             return;
         }
         catch (Exception error)
         {
             AutoCSer.Log.Pub.Log.add(Log.LogType.Error, error);
         }
     }while (searcher.isDisposed == 0 && (data = data.LinkNext) != null);
 }
コード例 #2
0
 /// <summary>
 /// 添加新的数据
 /// </summary>
 /// <param name="key"></param>
 /// <param name="text"></param>
 internal void Add(ref keyType key, string text)
 {
     getResult(text);
     if (result.Count != 0)
     {
         searcher.add(ref key, text, result);
         indexArrays.PrepLength(result.Count);
         foreach (ResultIndexLeftArray indexArray in result.Values)
         {
             indexArrays.UnsafeAdd(indexArray.Indexs.Array);
         }
     }
 }