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.
38 lines
813 B
C#
38 lines
813 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace ClosedXML_Tests.Utils
|
|
{
|
|
internal class TemporaryFile : IDisposable
|
|
{
|
|
internal TemporaryFile()
|
|
: this(System.IO.Path.ChangeExtension(System.IO.Path.GetTempFileName(), "xlsx"))
|
|
{ }
|
|
|
|
internal TemporaryFile(string path)
|
|
: this(path, false)
|
|
{ }
|
|
|
|
internal TemporaryFile(String path, bool preserve)
|
|
{
|
|
this.Path = path;
|
|
this.Preserve = preserve;
|
|
}
|
|
|
|
|
|
public string Path { get; private set; }
|
|
public bool Preserve { get; private set; }
|
|
|
|
public void Dispose()
|
|
{
|
|
if (!Preserve)
|
|
File.Delete(Path);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return this.Path;
|
|
}
|
|
}
|
|
}
|