mirror of
https://github.com/Tribufu/ServerManagers
synced 2026-08-09 12:41:06 +00:00
Removal of ToArray()
This commit is contained in:
parent
9eb22da9e7
commit
9f5cf132f0
41 changed files with 184 additions and 189 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Ionic.Zip;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
|
|
@ -68,11 +69,11 @@ namespace ServerManagerTool.Common.Utils
|
|||
}
|
||||
}
|
||||
|
||||
public static void UpdateFiles(string zipFile, string[] filesToZip, string comment = "", bool preserveDirHierarchy = true, string directoryPathInArchive = "")
|
||||
public static void UpdateFiles(string zipFile, IEnumerable<string> filesToZip, string comment = "", bool preserveDirHierarchy = true, string directoryPathInArchive = "")
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(zipFile))
|
||||
throw new ArgumentNullException(nameof(zipFile));
|
||||
if (filesToZip == null || filesToZip.Length == 0)
|
||||
if (!filesToZip.Any())
|
||||
return;
|
||||
|
||||
if (!File.Exists(zipFile))
|
||||
|
|
@ -160,11 +161,11 @@ namespace ServerManagerTool.Common.Utils
|
|||
}
|
||||
}
|
||||
|
||||
public static void ZipFiles(string zipFile, string[] filesToZip, string comment = "", bool preserveDirHierarchy = true, string directoryPathInArchive = "")
|
||||
public static void ZipFiles(string zipFile, IEnumerable<string> filesToZip, string comment = "", bool preserveDirHierarchy = true, string directoryPathInArchive = "")
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(zipFile))
|
||||
throw new ArgumentNullException(nameof(zipFile));
|
||||
if (filesToZip == null || filesToZip.Length == 0)
|
||||
if (!filesToZip.Any())
|
||||
throw new ArgumentNullException(nameof(filesToZip));
|
||||
|
||||
using (var zip = new ZipFile(zipFile))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue