private static Module TryLoadModule(string name) { var ns = typeof(ModuleSchemaTest).Namespace; string filename = name.ToLowerInvariant().Replace("-", "") + ".vdrum"; string resourceName = $"{ns}.{filename}"; using (var stream = typeof(ModuleSchemaTest).Assembly.GetManifestResourceStream(resourceName)) { if (stream == null) { return(null); } return((Module)ProtoIo.ReadStream(stream)); } }
// It's unpleasant having this here, but I'm not sure of the alternative... /// <summary> /// Reads the given stream as drum data, returning a Kit or a Module depending /// on the data within the stream. /// </summary> public static object ReadStream(Stream stream) => ProtoIo.ReadStream(stream);