private Stream getStream(string assembly, string resourceName)
{
Stream stream = constructStream(assembly, resourceName);
if (stream == null)
{
string template = "Resource file not found: {0}. Make sure the Build Action for the file is 'Embedded Resource'.";
throw new ApplicationException(string.Format(template, resourceName));
}
return stream;
}