From 4d01b2654db6bab59c592fdc9215f07415279d77 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 13 Apr 2026 22:18:31 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20rewire=20Program.cs=20DI=20?= =?UTF-8?q?=E2=80=94=20remove=20API/DB,=20add=20Excel=20and=20log=20servic?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- ExportDXF/Program.cs | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/ExportDXF/Program.cs b/ExportDXF/Program.cs index 05b5db5..12db29f 100644 --- a/ExportDXF/Program.cs +++ b/ExportDXF/Program.cs @@ -1,18 +1,12 @@ -using ExportDXF.ApiClient; using ExportDXF.Forms; using ExportDXF.Services; using System; -using System.Configuration; -using System.Net.Http; using System.Windows.Forms; namespace ExportDXF { static class Program { - /// - /// The main entry point for the application. - /// [STAThread] static void Main() { @@ -25,40 +19,32 @@ namespace ExportDXF } } - /// - /// Simple dependency injection container. - /// public class ServiceContainer { - private readonly string _apiBaseUrl; - - public ServiceContainer() - { - _apiBaseUrl = ConfigurationManager.AppSettings["FabWorksApiUrl"] ?? "http://localhost:5206"; - } - public MainForm ResolveMainForm() { var solidWorksService = new SolidWorksService(); var bomExtractor = new BomExtractor(); var partExporter = new PartExporter(); var drawingExporter = new DrawingExporter(); - - var httpClient = new HttpClient - { - BaseAddress = new Uri(_apiBaseUrl), - Timeout = TimeSpan.FromSeconds(30) - }; - var apiClient = new FabWorksApiClient(httpClient); + var excelExportService = new ExcelExportService(); + var logFileService = new LogFileService(); var exportService = new DxfExportService( solidWorksService, bomExtractor, partExporter, drawingExporter, - apiClient); + excelExportService, + logFileService); - return new MainForm(solidWorksService, exportService, apiClient); + var extractors = new IDrawingInfoExtractor[] + { + new EquipmentDrawingInfoExtractor(), + new DefaultDrawingInfoExtractor() + }; + + return new MainForm(solidWorksService, exportService, extractors); } } }