Skip to content

Commit 50fdb10

Browse files
committed
Manually implement pull request squid-box#78 to fix the progress for compressing.
1 parent 166d53b commit 50fdb10

File tree

8 files changed

+4136
-4026
lines changed

8 files changed

+4136
-4026
lines changed

SevenZip/7z.dll

-1.1 MB
Binary file not shown.

SevenZip/7z64.dll

-1.61 MB
Binary file not shown.

SevenZip/ArchiveExtractCallback.cs

Lines changed: 496 additions & 479 deletions
Large diffs are not rendered by default.

SevenZip/ArchiveUpdateCallback.cs

Lines changed: 737 additions & 712 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
3+
namespace SevenZip
4+
{
5+
/// <summary>
6+
/// Event args that pass a ulong total and a ulong completed value, that can be interpreted by the receiver.
7+
/// </summary>
8+
public sealed class DetailedProgressEventArgs : EventArgs
9+
{
10+
private readonly ulong _amountedCompleted;
11+
private readonly ulong _total;
12+
13+
/// <summary>
14+
/// Initializes a new instance of the DetailedProgressEventArgs class.
15+
/// </summary>
16+
/// <param name="amountCompleted">Amount of work that has been cumulatively completed.</param>
17+
/// <param name="total">The total amount of work to complete.</param>
18+
[CLSCompliant(false)]
19+
public DetailedProgressEventArgs(ulong amountCompleted, ulong total)
20+
{
21+
_amountedCompleted = Math.Min(total, amountCompleted);
22+
_total = total;
23+
}
24+
25+
/// <summary>
26+
/// Gets the amount of work that has been completed.
27+
/// </summary>
28+
[CLSCompliant(false)]
29+
public ulong AmountCompleted => _amountedCompleted;
30+
/// <summary>
31+
/// Gets the total amount of work to do.
32+
/// </summary>
33+
[CLSCompliant(false)]
34+
public ulong TotalAmount => _total;
35+
}
36+
}

SevenZip/SevenZip.csproj

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<AssemblyName>SevenZipSharp</AssemblyName>
4-
<TargetFrameworks>netstandard2.0;net45;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
55
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>SevenZip.snk</AssemblyOriginatorKeyFile>
77
<AssemblyTitle>SevenZipSharp</AssemblyTitle>
88
<Company>Markovtsev Vadim</Company>
99
<Product>SevenZipSharp</Product>
1010
<ProductVersion>1.0.0.0</ProductVersion>
11-
<AssemblyVersion>1.0.0.0</AssemblyVersion>
12-
<FileVersion>1.0.0.0</FileVersion>
11+
<AssemblyVersion>1.5.1</AssemblyVersion>
12+
<FileVersion>1.5.1</FileVersion>
1313
<InformationalVersion>1.0.0.0</InformationalVersion>
1414
<Description>7-zip native library wrapper</Description>
1515
<Copyright>Copyright (C) Markovtsev Vadim 2009, 2010, licensed under LGPLv3</Copyright>
@@ -19,6 +19,9 @@
1919
<RegisterForComInterop>false</RegisterForComInterop>
2020
<DefaultItemExcludes>$(DefaultItemExcludes);sfx\*</DefaultItemExcludes>
2121
<Configurations>Debug;Release;LiteDebug;LiteRelease</Configurations>
22+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
23+
<Version>1.5.1</Version>
24+
<BaseOutputPath>bin\</BaseOutputPath>
2225
</PropertyGroup>
2326
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2427
<DefineConstants>TRACE;DEBUG;UNMANAGED;SFX</DefineConstants>
@@ -35,12 +38,6 @@
3538
<DebugSymbols>true</DebugSymbols>
3639
</PropertyGroup>
3740
<ItemGroup>
38-
<Content Include="7z.dll">
39-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40-
</Content>
41-
<Content Include="7z64.dll">
42-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
43-
</Content>
4441
<None Include="SevenZip.snk" />
4542
</ItemGroup>
4643
<ItemGroup Condition="$(DefineConstants.Contains('SFX'))">

0 commit comments

Comments
 (0)