mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-05 12:08:46 +00:00
23 lines
563 B
Forth
23 lines
563 B
Forth
namespace WoofWare.Myriad.Plugins.Test
|
|
|
|
open System
|
|
open System.IO
|
|
open System.Reflection
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module Assembly =
|
|
|
|
let getEmbeddedResource (assembly : Assembly) (name : string) : string =
|
|
let names = assembly.GetManifestResourceNames ()
|
|
|
|
let names =
|
|
names |> Seq.filter (fun s -> s.EndsWith (name, StringComparison.Ordinal))
|
|
|
|
use s =
|
|
names
|
|
|> Seq.exactlyOne
|
|
|> assembly.GetManifestResourceStream
|
|
|> fun s -> new StreamReader (s)
|
|
|
|
s.ReadToEnd ()
|