internal void UriHitHandler(int node, Uri uri)
{
if (_uniqueUriRef != null)
{
if (_uniqueUriRef.Contains(uri))
{
if ((int)_uniqueUriRef[uri] != node)
{
throw new FileFormatException(SR.Get(SRID.XpsValidatingLoaderDuplicateReference));
}
}
else
{
_uniqueUriRef.Add(uri, node);
}
}
Hashtable validResources = _validResources.Peek();
if (validResources != null)
{
if (!validResources.ContainsKey(uri))
{
// The hashtable is case sensitive, packuris are not, so if we do not find in hashtable,
// do true comparison and add when found for next time...
bool found = false;
foreach (Uri resUri in validResources.Keys)
{
if (PackUriHelper.ComparePackUri(resUri, uri) == 0)
{
validResources.Add(uri, validResources[resUri]);
found = true;
break;
}
}
if (!found)
{
throw new FileFormatException(SR.Get(SRID.XpsValidatingLoaderUnlistedResource));
}
}
if (!(bool)validResources[uri])
{
throw new FileFormatException(SR.Get(SRID.XpsValidatingLoaderUnsupportedMimeType));
}
}
}