Loads an embedded resource file of the calling assembly.
/// <summary>
/// Loads an embedded resource file of the calling assembly.
/// </summary>
/// <param name="embeddedFileName">Filename to load, e.g. "data.xml"</param>
/// <returns>Stream to the embedded resource</returns>
public static Stream GetResourceStream(string embeddedFileName) {
Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream(Assembly.GetCallingAssembly().GetName().Name + ".Resources." + embeddedFileName);
return stream;
}
Kommentare zum Snippet