private string GetTextFromEmbeddedResource(string namespaceKey, string resourcePath)
{
var path = namespaceKey + "." + resourcePath.Replace("/", ".");
try
{
string text = null;
Stream stream = Assembly.Load(new AssemblyName(namespaceKey)).GetManifestResourceStream(path);
if (stream == null)
return null;
using (var textReader = new StreamReader(stream))
{
text = textReader.ReadToEnd();
}
return text;
}
catch (Exception ex)
{
throw ex.MvxWrap("Cannot load resource {0}", path);
}
}
}