Esempio n. 1
0
 /// <summary>
 /// 지정된 속성명의 인덱스를 제거합니다.
 /// </summary>
 /// <param name="propertyName">인덱스로 등록된 속성명</param>
 /// <returns>제거 여부. 속성명이 인덱스에 포함되어 있지 않다면 false를 반환한다.</returns>
 public bool RemoveIndex(string propertyName)
 {
     if (_indexes.ContainsKey(propertyName))
     {
         return(_indexes.Remove(propertyName));
     }
     return(false);
 }
        public override void RemoveFromIndex(object key, object value)
        {
            lock (_mutex)
            {
                Hashtable             attributeValues = value as Hashtable;
                IDictionaryEnumerator valuesDic       = attributeValues.GetEnumerator();

                while (valuesDic.MoveNext())
                {
                    string indexKey = (string)valuesDic.Key;

                    if (IndexTable.Contains(indexKey) || IndexTable.Contains(indexKey = ConvertToNamedTagKey(indexKey)))
                    {
                        IIndexStore store = IndexTable[indexKey] as IIndexStore;
                        object      val   = valuesDic.Value;

                        if (val != null)
                        {
                            store.Remove(val, key);
                        }
                        else
                        {
                            store.Remove("null", key);
                        }

                        if (store.Count == 0)
                        {
                            if (indexKey == TAG_INDEX_KEY || IsNamedTagKey(indexKey))
                            {
                                IndexTable.Remove(indexKey);
                            }
                            else
                            {
                                IndexTable[indexKey] = new HashStore();
                            }
                        }
                    }
                }
            }
        }