Resolver.GetEntity C# (CSharp) Method

GetEntity() public method

public GetEntity ( Uri, absoluteUri, string role, Type, type ) : object
absoluteUri Uri,
role string
type Type,
return object
	public override object GetEntity (Uri absoluteUri, string role, Type type)
	{
		return new MemoryStream (Encoding.UTF8.GetBytes ("<!ENTITY alpha \"bravo\">"));
	}
}

Usage Example

        public Grammar parse(string sourceURL)
        {
            Uri uri;

            try {
                uri = new Uri(sourceURL);
            } catch (UriFormatException) {
                uri = new Uri(Path.GetFullPath(sourceURL));
            }

            return(parse(
                       CreateXmlReader(uri.AbsoluteUri,
                                       (Stream)Resolver.GetEntity(uri, null, typeof(Stream)))));
        }
Resolver