private static void CheckJavaDuplicateIndexName(string fullName, NamedTagsDictionary namedTags, TypeInfoMap typeMap) { if (namedTags == null || typeMap == null) { return; } string typeName = fullName; typeName = typeName.Replace("+", "."); int handleId = typeMap.GetHandleId(typeName); if (handleId != -1) { ArrayList attributes = typeMap.GetAttribList(handleId); foreach (string name in attributes) { if (namedTags.Contains(name)) { throw new Exception("Key in named tags conflicts with the indexed attribute name of the specified object."); } } } }
private static void CheckDuplicateIndexName(object value, NamedTagsDictionary namedTags, TypeInfoMap typeMap) { if (namedTags == null || value == null || typeMap == null) { return; } string typeName = value.GetType().FullName; typeName = typeName.Replace("+", "."); int handleId = typeMap.GetHandleId(typeName); if (handleId != -1) { ArrayList attributes = typeMap.GetAttribList(handleId); foreach (string name in attributes) { if (namedTags.Contains(name)) //@UH whether this should be case insensitive { throw new Exception("Key in named tags conflicts with the indexed attribute name of the specified object."); } } } }
/// <summary> /// Verifica se existem itens com o nome publicados. /// </summary> /// <param name="value">Instancia.</param> /// <param name="namedTags">Dicionário com as tags nomeadas.</param> /// <param name="typeMap"></param> private static void CheckDuplicateIndexName(object value, NamedTagsDictionary namedTags, TypeInfoMap typeMap) { if (namedTags != null && value != null && typeMap != null) { int handleId = 0; if (value is CacheItemRecord) { handleId = typeMap.GetHandleId(((CacheItemRecord)value).TypeName); } else { handleId = typeMap.GetHandleId(value.GetType()); } if (handleId != -1) { foreach (string str2 in typeMap.GetAttribList(handleId)) { if (namedTags.Contains(str2)) { throw new Exception(ResourceMessageFormatter.Create(() => Properties.Resources.Exception_DuplicateIndexName).Format()); } } } } }