Plugin.EmbeddedResource/ResourceLoader.cs
/// <summary>
/// Attempts to find and return the given resource from within the specified assembly.
/// </summary>
/// <returns>The embedded resource as a byte array.</returns>
/// <param name="assembly"><see cref="Assembly"/> containing embedded resources.</param>
/// <param name="resource">Full name of embedded resource in <see cref="Assembly"/>.</param>
Attempts to find and return the given resource from within the specified assembly.
Attempts to find and return the given resource from within the specified assembly .
public static byte[] GetEmbeddedResourceBytes(Assembly assembly, string resource)
		{
			var stream = GetEmbeddedResourceStream(assembly, resource);
			using (var memoryStream = new MemoryStream())
			{
				stream.CopyTo(memoryStream);
				return memoryStream.ToArray();
			}
		}
public static byte [ ] GetEmbeddedResourceBytes ( Assembly assembly , string resource ) { var stream = GetEmbeddedResourceStream ( assembly , resource ) ; using ( var memoryStream = new MemoryStream ( ) ) { stream . CopyTo ( memoryStream ) ; return memoryStream . ToArray ( ) ; } }
Attempts to find and return the given resource from within the specified assembly.
Attempts to find and return the given resource from within the specified assembly .
The embedded resource as a byte array.
The embedded resource as a byte array .
assembly
Assembly
containing embedded resources.
containing embedded resources .
resource
string
Full name of embedded resource in .
Full name of embedded resource in .