public IDictionaryEnumerator GetEnumerator(string type, bool forTag) { lock (_mutex) { IDictionaryEnumerator en = IndexTable.GetEnumerator(); if (!forTag) { while (en.MoveNext()) { IIndexStore store = en.Value as IIndexStore; if ((string)en.Key != TAG_INDEX_KEY) { if (store != null) { return(store.GetEnumerator()); } } } } else { if (IndexTable.Contains(TAG_INDEX_KEY)) { IIndexStore store = IndexTable[TAG_INDEX_KEY] as IIndexStore; if (store != null) { return(store.GetEnumerator()); } } } } return(null); }
public IDictionaryEnumerator GetEnumerator(string typeName, bool forTag) { if (_indexTable.Contains(TAG_INDEX_KEY)) { IIndexStore store = _indexTable[TAG_INDEX_KEY] as IIndexStore; return(store.GetEnumerator()); } return(null); }
public IDictionaryEnumerator GetEnumerator(string type) { IDictionaryEnumerator en = _indexTable.GetEnumerator(); while (en.MoveNext()) { IIndexStore store = en.Value as IIndexStore; return(store.GetEnumerator()); } return(null); }
/// <summary> /// Recupera os dados filtrando pelo /// </summary> /// <param name="store">Armazenamento.</param> /// <param name="values">Valores dos parametros.</param> /// <param name="comparisonType">Tipo de comparação.</param> /// <param name="key">Chave que será usada na comparação.</param> /// <returns></returns> public System.Collections.ArrayList GetData(IIndexStore store, System.Collections.IDictionary values, ComparisonType comparisonType, object key) { var result = new System.Collections.Hashtable(); var parameterValue = Convert.ToInt32(_generator.Evaluate(values)); var keyValue = Convert.ToInt32(key); var enumerator = store.GetEnumerator(); while (enumerator.MoveNext()) { var leftValue = Convert.ToInt32(enumerator.Key); if ((_operator == BitwiseOperator.And && (leftValue & parameterValue) == keyValue) || (_operator == BitwiseOperator.Or && (leftValue | parameterValue) == keyValue)) { var enumerator4 = (enumerator.Value as System.Collections.Hashtable).GetEnumerator(); while (enumerator4.MoveNext()) { result[enumerator4.Key] = enumerator4.Value; } } } return(new System.Collections.ArrayList(result.Keys)); }
/// <summary> /// Recupera o enumerado dos dados do indice. /// </summary> /// <param name="typeName">Nome do tipo que será usado para filtra os dados.</param> /// <param name="forTag">Identifica ser o enumerado será recuperado para tags.</param> /// <returns></returns> public IDictionaryEnumerator GetEnumerator(string typeName, bool forTag) { IDictionaryEnumerator enumerator = _indexTable.GetEnumerator(); if (!forTag) { while (enumerator.MoveNext()) { IIndexStore store = enumerator.Value as IIndexStore; if (((string)enumerator.Key) != "$Tag$") { return(store.GetEnumerator()); } } } else if (_indexTable.Contains("$Tag$")) { IIndexStore store2 = _indexTable["$Tag$"] as IIndexStore; return(store2.GetEnumerator()); } return(null); }