using System;
using System.Resources;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Xml;
namespace Svg
{
internal class SvgDtdResolver : XmlUrlResolver
{
///
/// Maps a URI to an object containing the actual resource.
///
/// The URI returned from
/// The current implementation does not use this parameter when resolving URIs. This is provided for future extensibility purposes. For example, this can be mapped to the xlink:role and used as an implementation specific argument in other scenarios.
/// The type of object to return. The current implementation only returns System.IO.Stream objects.
///
/// A System.IO.Stream object or null if a type other than stream is specified.
///
///
/// is neither null nor a Stream type.
/// The specified URI is not an absolute URI.
///
/// is null.
/// There is a runtime error (for example, an interrupted server connection).
public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
{
if (absoluteUri.ToString().IndexOf("svg", StringComparison.InvariantCultureIgnoreCase) > -1)
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream("Svg.Resources.svg11.dtd");
}
else
{
return base.GetEntity(absoluteUri, role, ofObjectToReturn);
}
}
}
}