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
15 changes: 0 additions & 15 deletions src/MiniExcel.Core/Api/OpenXmlExporter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using MiniExcelLib.Core.OpenXml.Picture;

// ReSharper disable once CheckNamespace
namespace MiniExcelLib.Core;

Expand All @@ -8,19 +6,6 @@ public sealed partial class OpenXmlExporter
internal OpenXmlExporter() { }


[CreateSyncVersion]
public async Task AddPictureAsync(string path, CancellationToken cancellationToken = default, params MiniExcelPicture[] images)
{
using var stream = File.Open(path, FileMode.OpenOrCreate);
await MiniExcelPictureImplement.AddPictureAsync(stream, cancellationToken, images).ConfigureAwait(false);
}

[CreateSyncVersion]
public async Task AddPictureAsync(Stream excelStream, CancellationToken cancellationToken = default, params MiniExcelPicture[] images)
{
await MiniExcelPictureImplement.AddPictureAsync(excelStream, cancellationToken, images).ConfigureAwait(false);
}

[CreateSyncVersion]
public async Task<int> InsertSheetAsync(string path, object value, string? sheetName = "Sheet1", bool printHeader = true, bool overwriteSheet = false, OpenXmlConfiguration? configuration = null, CancellationToken cancellationToken = default)
{
Expand Down
15 changes: 14 additions & 1 deletion src/MiniExcel.Core/Api/OpenXmlTemplater.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using MiniExcelLib.Core.OpenXml.Picture;
using MiniExcelLib.Core.OpenXml.Templates;

// ReSharper disable once CheckNamespace
Expand All @@ -7,7 +8,19 @@ public sealed partial class OpenXmlTemplater
{
internal OpenXmlTemplater() { }


[CreateSyncVersion]
public async Task AddPictureAsync(string path, CancellationToken cancellationToken = default, params MiniExcelPicture[] images)
{
using var stream = File.Open(path, FileMode.OpenOrCreate);
await MiniExcelPictureImplement.AddPictureAsync(stream, cancellationToken, images).ConfigureAwait(false);
}

[CreateSyncVersion]
public async Task AddPictureAsync(Stream excelStream, CancellationToken cancellationToken = default, params MiniExcelPicture[] images)
{
await MiniExcelPictureImplement.AddPictureAsync(excelStream, cancellationToken, images).ConfigureAwait(false);
}

[CreateSyncVersion]
public async Task ApplyTemplateAsync(string path, string templatePath, object value,
OpenXmlConfiguration? configuration = null, CancellationToken cancellationToken = default)
Expand Down
8 changes: 0 additions & 8 deletions src/MiniExcel/Legacy/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,22 @@
namespace MiniExcelLibs.Attributes;


[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelColumnAttribute : MiniExcelColumnAttribute;

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelColumnIndexAttribute : MiniExcelColumnIndexAttribute
{
public ExcelColumnIndexAttribute(int excelColumnIndex) : base(excelColumnIndex) { }
public ExcelColumnIndexAttribute(string excelColumnName) : base(excelColumnName) { }
}

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelColumnNameAttribute(string excelColumnName) : MiniExcelColumnNameAttribute(columnName: excelColumnName);

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelColumnWidthAttribute(double width) : MiniExcelColumnWidthAttribute(width);

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelFormatAttribute(string format) : MiniExcelFormatAttribute(format);

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelIgnoreAttribute(bool excelIgnore = true) : MiniExcelIgnoreAttribute(excelIgnore);

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class ExcelSheetAttribute : MiniExcelSheetAttribute;

[Obsolete("This is a legacy attribute that will be removed in a future version. Please use the corresponding one from MiniExcelLib.Core.Attributes instead.")]
public sealed class DynamicExcelSheetAttribute(string key) : MiniExcelLib.Core.Attributes.DynamicExcelSheetAttribute(key);
Loading
Loading