mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-08 18:16:30 +00:00
Renamed LinqBridge to .NET 2.0 target.
Cleaned up some cross-versioning code.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30110.0
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{932BBFCC-76E3-45FF-90CA-6BE4FBF4A097}"
|
||||
EndProject
|
||||
@@ -22,7 +22,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.PortableTest"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.Test.Portable", "SharpCompress.Test\SharpCompress.Test.Portable.csproj", "{E9C3C94B-FB27-4B4F-B225-57513C254D37}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.LinqBridge", "SharpCompress\SharpCompress.LinqBridge.csproj", "{9A6F69DC-258D-4EB4-859E-09EFC7A14A3F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.NET2", "SharpCompress\SharpCompress.NET2.csproj", "{9A6F69DC-258D-4EB4-859E-09EFC7A14A3F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@@ -74,7 +74,11 @@ namespace SharpCompress.Archive
|
||||
where TEntry : IArchiveEntry
|
||||
where TVolume : IVolume
|
||||
{
|
||||
#if NET2
|
||||
foreach (var path in Directory.GetFiles(filePath, searchPattern, searchOption))
|
||||
#else
|
||||
foreach (var path in Directory.EnumerateDirectories(filePath, searchPattern, searchOption))
|
||||
#endif
|
||||
{
|
||||
var fileInfo = new FileInfo(path);
|
||||
writableArchive.AddEntry(path.Substring(filePath.Length), fileInfo.OpenRead(), true, fileInfo.Length,
|
||||
|
||||
@@ -93,7 +93,11 @@ namespace SharpCompress.Common.Rar.Headers
|
||||
{
|
||||
if (!Options.HasFlag(Options.KeepStreamsOpen))
|
||||
{
|
||||
#if NET2
|
||||
reader.Close();
|
||||
#else
|
||||
reader.Dispose();
|
||||
#endif
|
||||
}
|
||||
throw new InvalidFormatException("Error trying to read rar signature.", e);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\LinqBridge\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;DISABLE_TRACE</DefineConstants>
|
||||
<OutputPath>..\bin\NET2\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;DISABLE_TRACE;NET2</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
@@ -63,7 +63,7 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\LinqBridge\</OutputPath>
|
||||
<OutputPath>..\bin\NET2\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -35,7 +35,11 @@ namespace SharpCompress.Writer
|
||||
{
|
||||
throw new ArgumentException("Directory does not exist: " + directory);
|
||||
}
|
||||
foreach (string file in Directory.GetFiles(directory, searchPattern, option))
|
||||
#if NET2
|
||||
foreach (var file in Directory.GetFiles(directory, searchPattern, option))
|
||||
#else
|
||||
foreach (var file in Directory.EnumerateDirectories(directory, searchPattern, option))
|
||||
#endif
|
||||
{
|
||||
writer.Write(file.Substring(directory.Length), file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user