Added support for .NET 3.5

SharpCompress can now be compiled for .NET 3.5 by defining symbol NET35
This commit is contained in:
benshoof
2016-01-25 09:02:19 -09:00
parent 25d22e33a7
commit 1661b7ec36
9 changed files with 15 additions and 8 deletions

View File

@@ -60,7 +60,7 @@ namespace SharpCompress.Archive
this IWritableArchive writableArchive,
string filePath, string searchPattern = "*.*", SearchOption searchOption = SearchOption.AllDirectories)
{
#if NET2
#if NET35
foreach (var path in Directory.GetFiles(filePath, searchPattern, searchOption))
#else
foreach (var path in Directory.EnumerateFiles(filePath, searchPattern, searchOption))

View File

@@ -93,7 +93,7 @@ namespace SharpCompress.Common.Rar.Headers
{
if (!Options.HasFlag(Options.KeepStreamsOpen))
{
#if NET2
#if NET35
reader.Close();
#else
reader.Dispose();

View File

@@ -1,4 +1,5 @@
using System;
#if NET35
using System;
namespace SharpCompress
{
@@ -12,4 +13,5 @@ namespace SharpCompress
return (value & flagVal) == flagVal;
}
}
}
}
#endif

View File

@@ -287,6 +287,7 @@
<Compile Include="Crypto\PBKDF2.cs" />
<Compile Include="Crypto\RijndaelEngine.cs" />
<Compile Include="Crypto\Sha1Digest.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="IO\CountingWritableSubStream.cs" />
<Compile Include="IO\ListeningStream.cs" />
<Compile Include="IO\MarkingBinaryReader.cs" />

View File

@@ -129,7 +129,7 @@
<Compile Include="Common\FilePart.cs" />
<Compile Include="Common\Entry.cs" />
<Compile Include="Common\IEntry.cs" />
<Compile Include="Common\IEntry.Extensions.cs" />
<Compile Include="Common\IEntry.Extensions.cs" />
<Compile Include="Common\IVolume.cs" />
<Compile Include="Common\Rar\RarCryptoWrapper.cs" />
<Compile Include="Common\Rar\RarRijndael.Portable.cs" />
@@ -257,6 +257,7 @@
<Compile Include="Crypto\PBKDF2.cs" />
<Compile Include="Crypto\RijndaelEngine.cs" />
<Compile Include="Crypto\Sha1Digest.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="IO\CountingWritableSubStream.cs" />
<Compile Include="Common\EntryStream.cs">
<SubType>Code</SubType>

View File

@@ -131,7 +131,7 @@
<Compile Include="Common\FilePart.cs" />
<Compile Include="Common\Entry.cs" />
<Compile Include="Common\IEntry.cs" />
<Compile Include="Common\IEntry.Extensions.cs" />
<Compile Include="Common\IEntry.Extensions.cs" />
<Compile Include="Common\IVolume.cs" />
<Compile Include="Common\Rar\RarCryptoWrapper.cs" />
<Compile Include="Common\Rar\RarRijndael.cs" />
@@ -244,6 +244,7 @@
<Compile Include="Compressor\PPMd\PpmdProperties.cs" />
<Compile Include="Compressor\PPMd\PpmdStream.cs" />
<Compile Include="Compressor\Rar\RarStream.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="IO\CountingWritableSubStream.cs" />
<Compile Include="Common\EntryStream.cs">
<SubType>Code</SubType>

View File

@@ -273,6 +273,7 @@
<Compile Include="Crypto\RijndaelEngine.cs" />
<Compile Include="Crypto\Pack.cs" />
<Compile Include="Crypto\Sha1Digest.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="IO\AppendingStream.cs" />
<Compile Include="IO\CountingWritableSubStream.cs" />
<Compile Include="IO\ListeningStream.cs" />

View File

@@ -131,7 +131,7 @@
<Compile Include="Common\FilePart.cs" />
<Compile Include="Common\Entry.cs" />
<Compile Include="Common\IEntry.cs" />
<Compile Include="Common\IEntry.Extensions.cs" />
<Compile Include="Common\IEntry.Extensions.cs" />
<Compile Include="Common\IVolume.cs" />
<Compile Include="Common\Rar\RarCryptoWrapper.cs" />
<Compile Include="Common\Rar\RarRijndael.cs" />
@@ -244,6 +244,7 @@
<Compile Include="Compressor\PPMd\PpmdProperties.cs" />
<Compile Include="Compressor\PPMd\PpmdStream.cs" />
<Compile Include="Compressor\Rar\RarStream.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="IO\CountingWritableSubStream.cs" />
<Compile Include="Common\EntryStream.cs">
<SubType>Code</SubType>

View File

@@ -35,7 +35,7 @@ namespace SharpCompress.Writer
{
throw new ArgumentException("Directory does not exist: " + directory);
}
#if NET2
#if NET35
foreach (var file in Directory.GetFiles(directory, searchPattern, option))
#else
foreach (var file in Directory.EnumerateFiles(directory, searchPattern, option))