- Add database-first lookup for equipment/drawing number auto-fill when reopening previously exported files - Remove prefix prepending for named parts (only use prefix for PT## BOM items) - Create ExportRecord/BomItem/CutTemplate chains for Part and Assembly exports, not just Drawings - Add auto-incrementing item numbers across drawing numbers - Add content hashing (SHA256) for DXF and PDF versioning with stash/archive pattern - Add EF Core initial migration for ExportDxfDb Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
57 lines
1.6 KiB
C#
57 lines
1.6 KiB
C#
using ExportDXF.Forms;
|
|
using ExportDXF.Services;
|
|
using System;
|
|
using System.Configuration;
|
|
using System.Windows.Forms;
|
|
|
|
namespace ExportDXF
|
|
{
|
|
static class Program
|
|
{
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
var container = new ServiceContainer();
|
|
var mainForm = container.ResolveMainForm();
|
|
Application.Run(mainForm);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Simple dependency injection container.
|
|
/// </summary>
|
|
public class ServiceContainer
|
|
{
|
|
private readonly string _outputFolder;
|
|
|
|
public ServiceContainer()
|
|
{
|
|
_outputFolder = ConfigurationManager.AppSettings["ExportOutputFolder"] ?? @"C:\ExportDXF\Output";
|
|
}
|
|
|
|
public MainForm ResolveMainForm()
|
|
{
|
|
var solidWorksService = new SolidWorksService();
|
|
var bomExtractor = new BomExtractor();
|
|
var fileExportService = new FileExportService(_outputFolder);
|
|
var partExporter = new PartExporter(fileExportService);
|
|
var drawingExporter = new DrawingExporter();
|
|
|
|
var exportService = new DxfExportService(
|
|
solidWorksService,
|
|
bomExtractor,
|
|
partExporter,
|
|
drawingExporter,
|
|
fileExportService);
|
|
|
|
return new MainForm(solidWorksService, exportService, fileExportService);
|
|
}
|
|
}
|
|
}
|