diff --git a/SevenZip.Tests/SevenZip.Tests.csproj b/SevenZip.Tests/SevenZip.Tests.csproj
index 06cb59e..74d9685 100644
--- a/SevenZip.Tests/SevenZip.Tests.csproj
+++ b/SevenZip.Tests/SevenZip.Tests.csproj
@@ -10,10 +10,11 @@
Properties
SevenZip.Tests
SevenZip.Tests
- v4.6.1
+ v4.5
512
+
true
diff --git a/SevenZip/Formats.cs b/SevenZip/Formats.cs
index 3bd1d8d..74d7d83 100644
--- a/SevenZip/Formats.cs
+++ b/SevenZip/Formats.cs
@@ -370,7 +370,7 @@ internal static int GetMaxValue(Type type)
/// List of readable archive format interface guids for 7-zip COM interop.
///
internal static readonly Dictionary InFormatGuids =
- new Dictionary(20)
+ new Dictionary
#region InFormatGuids initialization
{
@@ -428,7 +428,7 @@ internal static int GetMaxValue(Type type)
/// List of writable archive format interface guids for 7-zip COM interop.
///
internal static readonly Dictionary OutFormatGuids =
- new Dictionary(2)
+ new Dictionary
#region OutFormatGuids initialization
{
@@ -443,7 +443,7 @@ internal static int GetMaxValue(Type type)
#endregion
internal static readonly Dictionary MethodNames =
- new Dictionary(6)
+ new Dictionary
#region MethodNames initialization
{
@@ -459,7 +459,7 @@ internal static int GetMaxValue(Type type)
#endregion
internal static readonly Dictionary InForOutFormats =
- new Dictionary(6)
+ new Dictionary
#region InForOutFormats initialization
{
diff --git a/SevenZip/LibraryManager.cs b/SevenZip/LibraryManager.cs
index 14a7338..a9a8812 100644
--- a/SevenZip/LibraryManager.cs
+++ b/SevenZip/LibraryManager.cs
@@ -60,7 +60,7 @@ private static string DetermineLibraryFilePath()
private static int _totalUsers;
// private static string _LibraryVersion;
- private static bool? _modifyCapabale;
+ private static bool? _modifyCapable;
private static void InitUserInFormat(object user, InArchiveFormat format)
{
@@ -151,12 +151,12 @@ public static bool ModifyCapable
{
lock (_syncRoot)
{
- if (!_modifyCapabale.HasValue)
+ if (!_modifyCapable.HasValue)
{
FileVersionInfo dllVersionInfo = FileVersionInfo.GetVersionInfo(_libraryFileName);
- _modifyCapabale = dllVersionInfo.FileMajorPart >= 9;
+ _modifyCapable = dllVersionInfo.FileMajorPart >= 9;
}
- return _modifyCapabale.Value;
+ return _modifyCapable.Value;
}
}
}
diff --git a/SevenZip/SevenZipCompressorAsynchronous.cs b/SevenZip/SevenZipCompressorAsynchronous.cs
index 981375b..5ccd809 100644
--- a/SevenZip/SevenZipCompressorAsynchronous.cs
+++ b/SevenZip/SevenZipCompressorAsynchronous.cs
@@ -2,11 +2,11 @@
{
using System.Collections.Generic;
using System.IO;
- using System.Threading;
partial class SevenZipCompressor
{
#region Delegates
+
private delegate void CompressFiles1Delegate(string archiveName, string[] fileFullNames);
private delegate void CompressFiles2Delegate(Stream archiveStream, string[] fileFullNames);
private delegate void CompressFiles3Delegate(string archiveName, int commonRootLength, string[] fileFullNames);
@@ -17,21 +17,13 @@ partial class SevenZipCompressor
private delegate void CompressFilesEncrypted3Delegate(string archiveName, int commonRootLength, string password, string[] fileFullNames);
private delegate void CompressFilesEncrypted4Delegate(Stream archiveStream, int commonRootLength, string password, string[] fileFullNames);
- private delegate void CompressDirectory1Delegate(string directory, string archiveName);
- private delegate void CompressDirectory2Delegate(string directory, Stream archiveStream);
- private delegate void CompressDirectory3Delegate(string directory, string archiveName, string password);
- private delegate void CompressDirectory4Delegate(string directory, Stream archiveStream, string password);
- private delegate void CompressDirectory5Delegate(string directory, string archiveName,
- string password, string searchPattern, bool recursion);
- private delegate void CompressDirectory6Delegate(string directory, Stream archiveStream,
- string password, string searchPattern, bool recursion);
-
- private delegate void CompressStream1Delegate(Stream inStream, Stream outStream);
- private delegate void CompressStream2Delegate(Stream inStream, Stream outStream, string password);
-
- private delegate void ModifyArchive1Delegate(string archiveName, Dictionary newFileNames);
- private delegate void ModifyArchive2Delegate(string archiveName, Dictionary newFileNames,
- string password);
+ private delegate void CompressDirectoryDelegate(string directory, string archiveName, string password, string searchPattern, bool recursion);
+ private delegate void CompressDirectory2Delegate(string directory, Stream archiveStream, string password, string searchPattern, bool recursion);
+
+ private delegate void CompressStreamDelegate(Stream inStream, Stream outStream, string password);
+
+ private delegate void ModifyArchiveDelegate(string archiveName, IDictionary newFileNames, string password);
+
#endregion
#region CompressFiles overloads
@@ -43,8 +35,7 @@ partial class SevenZipCompressor
public void BeginCompressFiles(string archiveName, params string[] fileFullNames)
{
SaveContext();
- new CompressFiles1Delegate(CompressFiles).BeginInvoke(archiveName, fileFullNames,
- AsyncCallbackImplementation, this);
+ new CompressFiles1Delegate(CompressFiles).BeginInvoke(archiveName, fileFullNames, AsyncCallbackImplementation, this);
}
///
@@ -56,22 +47,19 @@ public void BeginCompressFiles(string archiveName, params string[] fileFullNames
public void BeginCompressFiles(Stream archiveStream, params string[] fileFullNames)
{
SaveContext();
- new CompressFiles2Delegate(CompressFiles).BeginInvoke(archiveStream, fileFullNames,
- AsyncCallbackImplementation, this);
+ new CompressFiles2Delegate(CompressFiles).BeginInvoke(archiveStream, fileFullNames, AsyncCallbackImplementation, this);
}
-
+
///
/// Packs files into the archive asynchronously.
///
/// Array of file names to pack.
/// The length of the common root of the file names.
/// The archive file name.
- public void BeginCompressFiles(
- string archiveName, int commonRootLength, params string[] fileFullNames)
+ public void BeginCompressFiles(string archiveName, int commonRootLength, params string[] fileFullNames)
{
SaveContext();
- new CompressFiles3Delegate(CompressFiles).BeginInvoke(archiveName, commonRootLength, fileFullNames,
- AsyncCallbackImplementation, this);
+ new CompressFiles3Delegate(CompressFiles).BeginInvoke(archiveName, commonRootLength, fileFullNames, AsyncCallbackImplementation, this);
}
///
@@ -84,8 +72,7 @@ public void BeginCompressFiles(Stream archiveStream, params string[] fileFullNam
public void BeginCompressFiles(Stream archiveStream, int commonRootLength, params string[] fileFullNames)
{
SaveContext();
- new CompressFiles4Delegate(CompressFiles).BeginInvoke(archiveStream, commonRootLength, fileFullNames,
- AsyncCallbackImplementation, this);
+ new CompressFiles4Delegate(CompressFiles).BeginInvoke(archiveStream, commonRootLength, fileFullNames, AsyncCallbackImplementation, this);
}
///
@@ -97,8 +84,7 @@ public void BeginCompressFiles(Stream archiveStream, int commonRootLength, param
public void BeginCompressFilesEncrypted(string archiveName, string password, params string[] fileFullNames )
{
SaveContext();
- new CompressFilesEncrypted1Delegate(CompressFilesEncrypted).BeginInvoke(archiveName, password, fileFullNames,
- AsyncCallbackImplementation, this);
+ new CompressFilesEncrypted1Delegate(CompressFilesEncrypted).BeginInvoke(archiveName, password, fileFullNames, AsyncCallbackImplementation, this);
}
///
@@ -111,8 +97,7 @@ public void BeginCompressFilesEncrypted(string archiveName, string password, par
public void BeginCompressFilesEncrypted(Stream archiveStream, string password, params string[] fileFullNames)
{
SaveContext();
- new CompressFilesEncrypted2Delegate(CompressFilesEncrypted).BeginInvoke(archiveStream, password, fileFullNames,
- AsyncCallbackImplementation, this);
+ new CompressFilesEncrypted2Delegate(CompressFilesEncrypted).BeginInvoke(archiveStream, password, fileFullNames, AsyncCallbackImplementation, this);
}
///
@@ -125,8 +110,7 @@ public void BeginCompressFilesEncrypted(Stream archiveStream, string password, p
public void BeginCompressFilesEncrypted(string archiveName, int commonRootLength, string password, params string[] fileFullNames)
{
SaveContext();
- new CompressFilesEncrypted3Delegate(CompressFilesEncrypted).BeginInvoke(archiveName, commonRootLength, password,
- fileFullNames, AsyncCallbackImplementation, this);
+ new CompressFilesEncrypted3Delegate(CompressFilesEncrypted).BeginInvoke(archiveName, commonRootLength, password,fileFullNames, AsyncCallbackImplementation, this);
}
///
@@ -140,9 +124,9 @@ public void BeginCompressFilesEncrypted(string archiveName, int commonRootLength
public void BeginCompressFilesEncrypted(Stream archiveStream, int commonRootLength, string password, params string[] fileFullNames)
{
SaveContext();
- new CompressFilesEncrypted4Delegate(CompressFilesEncrypted).BeginInvoke(archiveStream, commonRootLength, password,
- fileFullNames, AsyncCallbackImplementation, this);
+ new CompressFilesEncrypted4Delegate(CompressFilesEncrypted).BeginInvoke(archiveStream, commonRootLength, password, fileFullNames, AsyncCallbackImplementation, this);
}
+
#endregion
#region BeginCompressDirectory overloads
@@ -155,12 +139,10 @@ public void BeginCompressFilesEncrypted(Stream archiveStream, int commonRootLeng
/// The archive password.
/// Search string, such as "*.txt".
/// If true, files will be searched for recursively; otherwise, not.
- public void BeginCompressDirectory(string directory, string archiveName,
- string password = "", string searchPattern = "*", bool recursion = true)
+ public void BeginCompressDirectory(string directory, string archiveName, string password = "", string searchPattern = "*", bool recursion = true)
{
SaveContext();
- new CompressDirectory5Delegate(CompressDirectory).BeginInvoke(directory, archiveName,
- password, searchPattern, recursion, AsyncCallbackImplementation, this);
+ new CompressDirectoryDelegate(CompressDirectory).BeginInvoke(directory, archiveName, password, searchPattern, recursion, AsyncCallbackImplementation, this);
}
///
@@ -172,14 +154,13 @@ public void BeginCompressFilesEncrypted(Stream archiveStream, int commonRootLeng
/// The archive password.
/// Search string, such as "*.txt".
/// If true, files will be searched for recursively; otherwise, not.
- public void BeginCompressDirectory(string directory, Stream archiveStream,
- string password , string searchPattern = "*", bool recursion = true)
+ public void BeginCompressDirectory(string directory, Stream archiveStream, string password , string searchPattern = "*", bool recursion = true)
{
SaveContext();
- new CompressDirectory6Delegate(CompressDirectory).BeginInvoke(directory, archiveStream,
- password, searchPattern, recursion, AsyncCallbackImplementation, this);
+ new CompressDirectory2Delegate(CompressDirectory).BeginInvoke(directory, archiveStream, password, searchPattern, recursion, AsyncCallbackImplementation, this);
}
-#endregion
+
+ #endregion
#region BeginCompressStream overloads
@@ -193,11 +174,11 @@ public void BeginCompressFilesEncrypted(Stream archiveStream, int commonRootLeng
public void BeginCompressStream(Stream inStream, Stream outStream, string password = "")
{
SaveContext();
- (new CompressStream2Delegate(CompressStream)).BeginInvoke(inStream, outStream, password, AsyncCallbackImplementation, this);
+ new CompressStreamDelegate(CompressStream).BeginInvoke(inStream, outStream, password, AsyncCallbackImplementation, this);
}
#endregion
-
+
#region BeginModifyArchive overloads
///
@@ -206,11 +187,10 @@ public void BeginCompressStream(Stream inStream, Stream outStream, string passwo
/// The archive file name.
/// New file names. Null value to delete the corresponding index.
/// The archive password.
- public void BeginModifyArchive(string archiveName, Dictionary newFileNames,
- string password = "")
+ public void BeginModifyArchive(string archiveName, IDictionary newFileNames, string password = "")
{
SaveContext();
- new ModifyArchive2Delegate(ModifyArchive).BeginInvoke(archiveName, newFileNames, password, AsyncCallbackImplementation, this);
+ new ModifyArchiveDelegate(ModifyArchive).BeginInvoke(archiveName, newFileNames, password, AsyncCallbackImplementation, this);
}
#endregion
diff --git a/SevenZip/SevenZipSfx.cs b/SevenZip/SevenZipSfx.cs
index 14e03f1..78fcfd0 100644
--- a/SevenZip/SevenZipSfx.cs
+++ b/SevenZip/SevenZipSfx.cs
@@ -47,7 +47,7 @@ public class SevenZipSfx
{
get
{
- var result = new Dictionary>(3)
+ var result = new Dictionary>
{
{SfxModule.Simple, new List(2) {"7z.sfx", "7zCon.sfx"}},
{SfxModule.Installer, new List(2) {"7zS.sfx", "7zSD.sfx"}}
@@ -89,8 +89,9 @@ public SevenZipSfx(SfxModule module)
{
if (module == SfxModule.Custom)
{
- throw new ArgumentException("You must specify the custom module executable.", "module");
+ throw new ArgumentException("You must specify the custom module executable.", nameof(module));
}
+
_module = module;
CommonInit();
}
diff --git a/SevenZip/StreamWrappers.cs b/SevenZip/StreamWrappers.cs
index d7e6f7c..2bb9a4e 100644
--- a/SevenZip/StreamWrappers.cs
+++ b/SevenZip/StreamWrappers.cs
@@ -230,8 +230,7 @@ private void OnBytesWritten(IntEventArgs e)
///
internal class MultiStreamWrapper : DisposeVariableWrapper, IDisposable
{
- protected readonly Dictionary> StreamOffsets =
- new Dictionary>();
+ protected readonly Dictionary> StreamOffsets = new Dictionary>();
protected readonly List Streams = new List();
protected int CurrentStream;