mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
6bd3bb7bca
- (Add) Layer action - Export layers to HTML: Export file information and layers to an html file - (Change) CXDLP: Validate header and footer value must start with "CXSW3D" instead of force equal to "CXSW3DV2" (#501) - (Upgrade) .NET from 6.0.5 to 6.0.6
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
using UVtools.Core.Operations;
|
|
|
|
namespace UVtools.WPF.Controls.Tools
|
|
{
|
|
public partial class ToolLayerExportHtmlControl : ToolControl
|
|
{
|
|
public OperationLayerExportHtml Operation => BaseOperation as OperationLayerExportHtml;
|
|
public ToolLayerExportHtmlControl()
|
|
{
|
|
BaseOperation = new OperationLayerExportHtml(SlicerFile);
|
|
if (!ValidateSpawn()) return;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public async void ChooseFilePath()
|
|
{
|
|
var dialog = new SaveFileDialog
|
|
{
|
|
Filters = new List<FileDialogFilter>
|
|
{
|
|
new()
|
|
{
|
|
Extensions = new List<string>{"html"},
|
|
Name = "HTML files"
|
|
}
|
|
},
|
|
InitialFileName = Path.GetFileName(SlicerFile.FileFullPath) + ".html",
|
|
Directory = Path.GetDirectoryName(SlicerFile.FileFullPath)
|
|
};
|
|
var file = await dialog.ShowAsync(ParentWindow);
|
|
if (string.IsNullOrWhiteSpace(file)) return;
|
|
Operation.FilePath = file;
|
|
}
|
|
}
|
|
}
|