Files
ExportDXF/ExportDXF/Program.cs
AJ Isaacs 719dca1ca5 feat: add export history auto-fill, fix filename prefixes, persist records for all doc types
- 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>
2026-02-17 13:09:02 -05:00

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);
}
}
}