diff --git a/File_Format_Library/FileFormats/Archives/ARC.cs b/File_Format_Library/FileFormats/Archives/ARC.cs index 1e008243..de2e1b20 100644 --- a/File_Format_Library/FileFormats/Archives/ARC.cs +++ b/File_Format_Library/FileFormats/Archives/ARC.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/BEA.cs b/File_Format_Library/FileFormats/Archives/BEA.cs index e94160be..7e4d433e 100644 --- a/File_Format_Library/FileFormats/Archives/BEA.cs +++ b/File_Format_Library/FileFormats/Archives/BEA.cs @@ -23,11 +23,9 @@ namespace FirstPlugin public bool CanReplaceFiles { get; set; } = true; public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool CanSave { get; set; } public string[] Description { get; set; } = new string[] { "Bevel Engine Archive" }; diff --git a/File_Format_Library/FileFormats/Archives/GFA.cs b/File_Format_Library/FileFormats/Archives/GFA.cs index 0e05abdf..32b3b14e 100644 --- a/File_Format_Library/FileFormats/Archives/GFA.cs +++ b/File_Format_Library/FileFormats/Archives/GFA.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } private uint Unknown1; private uint Version; diff --git a/File_Format_Library/FileFormats/Archives/GFPAK.cs b/File_Format_Library/FileFormats/Archives/GFPAK.cs index 9456ca54..126c37da 100644 --- a/File_Format_Library/FileFormats/Archives/GFPAK.cs +++ b/File_Format_Library/FileFormats/Archives/GFPAK.cs @@ -93,11 +93,9 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool CanAddFiles { get; set; } = false; public bool CanRenameFiles { get; set; } = false; diff --git a/File_Format_Library/FileFormats/Archives/IGA_PAK.cs b/File_Format_Library/FileFormats/Archives/IGA_PAK.cs index 9cd47b99..f855590d 100644 --- a/File_Format_Library/FileFormats/Archives/IGA_PAK.cs +++ b/File_Format_Library/FileFormats/Archives/IGA_PAK.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/LZARC.cs b/File_Format_Library/FileFormats/Archives/LZARC.cs index 6976df84..0e516f08 100644 --- a/File_Format_Library/FileFormats/Archives/LZARC.cs +++ b/File_Format_Library/FileFormats/Archives/LZARC.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/ME01.cs b/File_Format_Library/FileFormats/Archives/ME01.cs index a95342db..4612f6e1 100644 --- a/File_Format_Library/FileFormats/Archives/ME01.cs +++ b/File_Format_Library/FileFormats/Archives/ME01.cs @@ -48,11 +48,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } private uint Alignment; public void Load(System.IO.Stream stream) diff --git a/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs b/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs index a6de5b99..669f8fc6 100644 --- a/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs +++ b/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/NXARC.cs b/File_Format_Library/FileFormats/Archives/NXARC.cs index c16ae0cd..40c781a0 100644 --- a/File_Format_Library/FileFormats/Archives/NXARC.cs +++ b/File_Format_Library/FileFormats/Archives/NXARC.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/RARC.cs b/File_Format_Library/FileFormats/Archives/RARC.cs index bb55b6be..ab22a82f 100644 --- a/File_Format_Library/FileFormats/Archives/RARC.cs +++ b/File_Format_Library/FileFormats/Archives/RARC.cs @@ -46,14 +46,11 @@ namespace FirstPlugin public List files = new List(); public List nodes = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } - + public IEnumerable Files => files; public IEnumerable Nodes => nodes; + public void ClearFiles() { files.Clear(); } + public string Name { get { return FileName; } diff --git a/File_Format_Library/FileFormats/Archives/SARC.cs b/File_Format_Library/FileFormats/Archives/SARC.cs index ed69bab0..5a5185e8 100644 --- a/File_Format_Library/FileFormats/Archives/SARC.cs +++ b/File_Format_Library/FileFormats/Archives/SARC.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } = true; public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public SarcData sarcData; public string SarcHash; diff --git a/File_Format_Library/FileFormats/Archives/SDF.cs b/File_Format_Library/FileFormats/Archives/SDF.cs index 7f831ddb..aebdb5fd 100644 --- a/File_Format_Library/FileFormats/Archives/SDF.cs +++ b/File_Format_Library/FileFormats/Archives/SDF.cs @@ -45,10 +45,9 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } SDFTOC_Header Header; public SDFTOC_Block2[] block2Array; diff --git a/File_Format_Library/FileFormats/Archives/SP2.cs b/File_Format_Library/FileFormats/Archives/SP2.cs index 0ad2b860..44f2cae0 100644 --- a/File_Format_Library/FileFormats/Archives/SP2.cs +++ b/File_Format_Library/FileFormats/Archives/SP2.cs @@ -39,11 +39,9 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool CanAddFiles { get; set; } public bool CanRenameFiles { get; set; } diff --git a/File_Format_Library/FileFormats/Archives/TMPK.cs b/File_Format_Library/FileFormats/Archives/TMPK.cs index efa0c63e..9cc8a925 100644 --- a/File_Format_Library/FileFormats/Archives/TMPK.cs +++ b/File_Format_Library/FileFormats/Archives/TMPK.cs @@ -46,11 +46,10 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool CanAddFiles { get; set; } = true; public bool CanRenameFiles { get; set; } = true; diff --git a/File_Format_Library/FileFormats/Archives/U8.cs b/File_Format_Library/FileFormats/Archives/U8.cs index 4367a4b5..e9874e9d 100644 --- a/File_Format_Library/FileFormats/Archives/U8.cs +++ b/File_Format_Library/FileFormats/Archives/U8.cs @@ -46,14 +46,11 @@ namespace FirstPlugin public List nodes = new List(); - public IEnumerable Files - { - get { return null; } - set { } - } - + public IEnumerable Files => null; public IEnumerable Nodes => nodes; + public void ClearFiles() { nodes.Clear(); } + public string Name { get { return FileName; } diff --git a/File_Format_Library/FileFormats/Rom/GCDisk.cs b/File_Format_Library/FileFormats/Rom/GCDisk.cs index 9be8e610..7863f3fd 100644 --- a/File_Format_Library/FileFormats/Rom/GCDisk.cs +++ b/File_Format_Library/FileFormats/Rom/GCDisk.cs @@ -36,11 +36,9 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool Identify(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Rom/IStorage.cs b/File_Format_Library/FileFormats/Rom/IStorage.cs index 0e6f07a9..b3706c18 100644 --- a/File_Format_Library/FileFormats/Rom/IStorage.cs +++ b/File_Format_Library/FileFormats/Rom/IStorage.cs @@ -35,11 +35,9 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool Identify(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Rom/NCA.cs b/File_Format_Library/FileFormats/Rom/NCA.cs index 177c1120..86cd201a 100644 --- a/File_Format_Library/FileFormats/Rom/NCA.cs +++ b/File_Format_Library/FileFormats/Rom/NCA.cs @@ -35,10 +35,9 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files { - get { return Files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool Identify(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Rom/NSP.cs b/File_Format_Library/FileFormats/Rom/NSP.cs index 61a80ce1..fbcba09c 100644 --- a/File_Format_Library/FileFormats/Rom/NSP.cs +++ b/File_Format_Library/FileFormats/Rom/NSP.cs @@ -45,11 +45,9 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files - { - get { return files; } - set { } - } + public IEnumerable Files => files; + + public void ClearFiles() { files.Clear(); } public bool Identify(System.IO.Stream stream) { diff --git a/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs b/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs index 0fdb3ad3..c3bea0aa 100644 --- a/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs +++ b/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs @@ -27,8 +27,9 @@ namespace Toolbox.Library bool CanReplaceFiles { get; } bool CanDeleteFiles { get; } - IEnumerable Files { get; set; } + IEnumerable Files { get; } + void ClearFiles(); bool AddFile(ArchiveFileInfo archiveFileInfo); bool DeleteFile(ArchiveFileInfo archiveFileInfo); } @@ -296,7 +297,7 @@ namespace Toolbox.Library progressBar.Task = "Repacking Files..."; progressBar.Refresh(); - (ArchiveFile.Files as List)?.Clear(); + ArchiveFile.ClearFiles(); for (int i = 0; i < ProccessedFiles.Count; i++) {