Initial commit of the ClosedXML library
Establishes the foundational structure, core Excel functionality, and tooling. - Implements base components for cells, ranges, columns, and rows. - Integrates a custom calculation engine with a wide range of Excel functions. - Adds comprehensive support for styling, conditional formatting, data validation, comments, pictures, and charts. - Configures build setup, project metadata (NuGet), and developer guidelines. - Includes editor and Git attributes for consistent code style and line endings.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Packaging;
|
||||
|
||||
namespace ClosedXML_Tests
|
||||
{
|
||||
internal static class ExcelDocsComparer
|
||||
{
|
||||
public static bool Compare(string left, string right, out string message)
|
||||
{
|
||||
using (FileStream leftStream = File.OpenRead(left))
|
||||
using (FileStream rightStream = File.OpenRead(right))
|
||||
{
|
||||
return Compare(leftStream, rightStream, out message);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Compare(Stream left, Stream right, out string message)
|
||||
{
|
||||
using (Package leftPackage = Package.Open(left, FileMode.Open, FileAccess.Read))
|
||||
using (Package rightPackage = Package.Open(right, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
return PackageHelper.Compare(leftPackage, rightPackage, false, ExcludeMethod, out message);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool ExcludeMethod(Uri uri)
|
||||
{
|
||||
//Exclude service data
|
||||
if (uri.OriginalString.EndsWith(".rels") ||
|
||||
uri.OriginalString.EndsWith(".psmdcp"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user