mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
16 lines
505 B
C#
16 lines
505 B
C#
using System.Reflection;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Poetry.Resources;
|
|
|
|
internal static class Resource
|
|
{
|
|
internal static class Streams
|
|
{
|
|
public static Stream Title => GetStream();
|
|
}
|
|
|
|
private static Stream GetStream([CallerMemberName] string? name = null) =>
|
|
Assembly.GetExecutingAssembly().GetManifestResourceStream($"{typeof(Resource).Namespace}.{name}.txt")
|
|
?? throw new Exception($"Could not find embedded resource stream '{name}'.");
|
|
} |