private static void ListArchive(ArchiveGenerationParameters parameters) { var filename = parameters.ListInput; if (!Path.HasExtension(filename)) { filename = Path.ChangeExtension(filename, "uvarc"); } try { var archive = ContentArchive.FromArchiveFile(() => File.OpenRead(filename)); foreach (var node in archive) { ListArchive(node, 0); } } catch (FileNotFoundException) { Console.WriteLine("File not found."); } catch (DirectoryNotFoundException) { Console.WriteLine("File not found."); } }
/// <summary> /// Sets the file system source to an archive file loaded from a manifest resource stream, /// if the specified manifest resource exists. /// </summary> /// <param name="name">The name of the manifest resource being loaded as the file system source.</param> protected void SetFileSourceFromManifestIfExists(String name) { Contract.RequireNotEmpty(name, nameof(name)); var asm = GetType().Assembly; if (asm.GetManifestResourceNames().Contains(name)) { FileSystemService.Source = ContentArchive.FromArchiveFile(() => { return(asm.GetManifestResourceStream(name)); }); } }