Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.csproj.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<IsPackable>false</IsPackable>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<!-- Packaging -->
Expand Down
1 change: 1 addition & 0 deletions OpenMcdf/RootStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace OpenMcdf;
/// <summary>
/// Represents the major version of the compound file.
/// </summary>
[SuppressMessage("Design", "CA1028:Enum Storage should be Int32", Justification = "Compound file versions are defined as ushort.")]
public enum Version : ushort
{
/// <summary>
Expand Down
29 changes: 17 additions & 12 deletions OpenMcdf/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,23 @@ public void CopyTo(Storage destination)

foreach (DirectoryEntry entry in EnumerateDirectoryEntries())
{
if (entry.Type is StorageType.Storage)
{
Storage subSource = new(ContextSite, entry, this);
Storage subDestination = destination.CreateStorage(entry.NameString);
subSource.CopyTo(subDestination);
}
else if (entry.Type is StorageType.Stream)
{
using CfbStream stream = new(ContextSite, entry, this);
using CfbStream destinationStream = destination.CreateStream(entry.NameString);
stream.CopyTo(destinationStream);
}
Copy(entry, destination);
}
}

private void Copy(DirectoryEntry entry, Storage destination)
{
if (entry.Type is StorageType.Storage)
{
Storage subSource = new(ContextSite, entry, this);
Storage subDestination = destination.CreateStorage(entry.NameString);
subSource.CopyTo(subDestination);
}
else if (entry.Type is StorageType.Stream)
{
using CfbStream stream = new(ContextSite, entry, this);
using CfbStream destinationStream = destination.CreateStream(entry.NameString);
stream.CopyTo(destinationStream);
}
}

Expand Down
4 changes: 3 additions & 1 deletion OpenMcdf/System/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[*.cs]
dotnet_analyzer_diagnostic.severity = none
dotnet_analyzer_diagnostic.severity = none

dotnet_diagnostic.CA1019.severity = none
File renamed without changes.
1 change: 1 addition & 0 deletions OpenMcdf/TransactedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace OpenMcdf;
internal sealed class TransactedStream : Stream
{
readonly RootContextSite rootContextSite;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Non-dispose ownership")]
readonly Stream originalStream;
readonly Dictionary<uint, long> dirtySectorPositions = new();
readonly byte[] buffer;
Expand Down
Loading