From 39a9baf5c618d8d79c75b89e2d5c4020939697f2 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 14 Oct 2024 22:18:03 +0200 Subject: [PATCH] Added dependency injection --- imagecatalog/ImageCatalog 2.csproj | 5 +- imagecatalog/MainForm.cs | 7 +- .../My Project/Application.Designer.cs | 38 --- .../My Project/Application.Designer.vb | 38 --- imagecatalog/My Project/Application.myapp | 10 - .../MyNamespace.Dynamic.Designer.cs | 58 ---- .../MyNamespace.Static.1.Designer.cs | 305 ------------------ imagecatalog/My Project/Settings.Designer.cs | 26 -- imagecatalog/My Project/Settings.Designer.vb | 73 ----- imagecatalog/My Project/Settings.settings | 6 - imagecatalog/My Project/app.manifest | 22 -- imagecatalog/Program.cs | 34 ++ imagecatalog/Services/TestService.cs | 18 ++ 13 files changed, 59 insertions(+), 581 deletions(-) delete mode 100644 imagecatalog/My Project/Application.Designer.cs delete mode 100644 imagecatalog/My Project/Application.Designer.vb delete mode 100644 imagecatalog/My Project/Application.myapp delete mode 100644 imagecatalog/My Project/MyNamespace.Dynamic.Designer.cs delete mode 100644 imagecatalog/My Project/MyNamespace.Static.1.Designer.cs delete mode 100644 imagecatalog/My Project/Settings.Designer.cs delete mode 100644 imagecatalog/My Project/Settings.Designer.vb delete mode 100644 imagecatalog/My Project/Settings.settings delete mode 100644 imagecatalog/My Project/app.manifest create mode 100644 imagecatalog/Program.cs create mode 100644 imagecatalog/Services/TestService.cs diff --git a/imagecatalog/ImageCatalog 2.csproj b/imagecatalog/ImageCatalog 2.csproj index 1c26623..b782331 100644 --- a/imagecatalog/ImageCatalog 2.csproj +++ b/imagecatalog/ImageCatalog 2.csproj @@ -21,10 +21,6 @@ embedded - - MyApplicationCodeGenerator - Application.Designer.cs - SettingsSingleFileGenerator Settings.Designer.cs @@ -38,6 +34,7 @@ + diff --git a/imagecatalog/MainForm.cs b/imagecatalog/MainForm.cs index 52b720c..e074f8c 100644 --- a/imagecatalog/MainForm.cs +++ b/imagecatalog/MainForm.cs @@ -11,6 +11,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using CatalogVbLib; +using ImageCatalog_2.Services; using MaddoShared; using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; @@ -22,8 +23,12 @@ namespace ImageCatalog public partial class MainForm { - public MainForm() + private readonly ITestService _service; + + public MainForm(ITestService testService) { + _service = testService; + InitializeComponent(); _Button3.Name = "Button3"; _Button2.Name = "Button2"; diff --git a/imagecatalog/My Project/Application.Designer.cs b/imagecatalog/My Project/Application.Designer.cs deleted file mode 100644 index 1c924b5..0000000 --- a/imagecatalog/My Project/Application.Designer.cs +++ /dev/null @@ -1,38 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; - -namespace ImageCatalog.My -{ - - // NOTE: This file is auto-generated; do not modify it directly. To make changes, - // or if you encounter build errors in this file, go to the Project Designer - // (go to Project Properties or double-click the My Project node in - // Solution Explorer), and make changes on the Application tab. - // - internal partial class MyApplication - { - [DebuggerStepThrough()] - public MyApplication() : base(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - { - IsSingleInstance = false; - EnableVisualStyles = true; - SaveMySettingsOnExit = true; - ShutdownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses; - } - - [DebuggerStepThrough()] - protected override void OnCreateMainForm() - { - MainForm = MyProject.Forms.MainForm; - } - } -} \ No newline at end of file diff --git a/imagecatalog/My Project/Application.Designer.vb b/imagecatalog/My Project/Application.Designer.vb deleted file mode 100644 index 24fc37f..0000000 --- a/imagecatalog/My Project/Application.Designer.vb +++ /dev/null @@ -1,38 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict Off -Option Explicit On - - -Namespace My - - 'NOTE: This file is auto-generated; do not modify it directly. To make changes, - ' or if you encounter build errors in this file, go to the Project Designer - ' (go to Project Properties or double-click the My Project node in - ' Solution Explorer), and make changes on the Application tab. - ' - Partial Friend Class MyApplication - - _ - Public Sub New() - MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - Me.IsSingleInstance = false - Me.EnableVisualStyles = true - Me.SaveMySettingsOnExit = true - Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses - End Sub - - _ - Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.ImageCatalog.MainForm - End Sub - End Class -End Namespace diff --git a/imagecatalog/My Project/Application.myapp b/imagecatalog/My Project/Application.myapp deleted file mode 100644 index c9098c2..0000000 --- a/imagecatalog/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - true - MainForm - false - 0 - true - 0 - true - \ No newline at end of file diff --git a/imagecatalog/My Project/MyNamespace.Dynamic.Designer.cs b/imagecatalog/My Project/MyNamespace.Dynamic.Designer.cs deleted file mode 100644 index 5f1eb17..0000000 --- a/imagecatalog/My Project/MyNamespace.Dynamic.Designer.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.ComponentModel; -using System.Diagnostics; - -namespace ImageCatalog.My -{ - internal static partial class MyProject - { - internal partial class MyForms - { - [EditorBrowsable(EditorBrowsableState.Never)] - public Form1 m_Form1; - - public Form1 Form1 - { - [DebuggerHidden] - get - { - m_Form1 = Create__Instance__(m_Form1); - return m_Form1; - } - - [DebuggerHidden] - set - { - if (ReferenceEquals(value, m_Form1)) - return; - if (value is object) - throw new ArgumentException("Property can only be set to Nothing"); - Dispose__Instance__(ref m_Form1); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public MainForm m_MainForm; - - public MainForm MainForm - { - [DebuggerHidden] - get - { - m_MainForm = Create__Instance__(m_MainForm); - return m_MainForm; - } - - [DebuggerHidden] - set - { - if (ReferenceEquals(value, m_MainForm)) - return; - if (value is object) - throw new ArgumentException("Property can only be set to Nothing"); - Dispose__Instance__(ref m_MainForm); - } - } - } - } -} \ No newline at end of file diff --git a/imagecatalog/My Project/MyNamespace.Static.1.Designer.cs b/imagecatalog/My Project/MyNamespace.Static.1.Designer.cs deleted file mode 100644 index 5212c44..0000000 --- a/imagecatalog/My Project/MyNamespace.Static.1.Designer.cs +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections; -using System.Diagnostics; -using System.Windows.Forms; -using Microsoft.VisualBasic; - -/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ -/* TODO ERROR: Skipped IfDirectiveTrivia */ -/* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia */ -/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ -/* TODO ERROR: Skipped IfDirectiveTrivia */ -namespace ImageCatalog.My -{ - - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - { - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [STAThread()] - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static void Main(string[] Args) - { - try - { - Application.SetCompatibleTextRenderingDefault(UseCompatibleTextRendering); - } - finally - { - } - - MyProject.Application.Run(Args); - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer - { - /* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static partial class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped IfDirectiveTrivia */ - /* TODO ERROR: Skipped DefineDirectiveTrivia */ - [System.ComponentModel.Design.HelpKeyword("My.Forms")] - internal static MyForms Forms - { - [DebuggerHidden()] - get - { - return m_MyFormsObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Windows.Forms.Form", "Create__Instance__", "Dispose__Instance__", "My.MyProject.Forms")] - internal sealed partial class MyForms - { - [DebuggerHidden()] - private static T Create__Instance__(T Instance) where T : Form, new() - { - if (Instance is null || Instance.IsDisposed) - { - if (m_FormBeingCreated is object) - { - if (m_FormBeingCreated.ContainsKey(typeof(T)) == true) - { - throw new InvalidOperationException(Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")); - } - } - else - { - m_FormBeingCreated = new Hashtable(); - } - - m_FormBeingCreated.Add(typeof(T), null); - try - { - return new T(); - } - catch (System.Reflection.TargetInvocationException ex) when (ex.InnerException is object) - { - string BetterMessage = Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message); - throw new InvalidOperationException(BetterMessage, ex.InnerException); - } - finally - { - m_FormBeingCreated.Remove(typeof(T)); - } - } - else - { - return Instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) where T : Form - { - instance.Dispose(); - instance = null; - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyForms() : base() - { - } - - [ThreadStatic()] - private static Hashtable m_FormBeingCreated; - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object o) - { - return base.Equals(o); - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() - { - return base.GetHashCode(); - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal new Type GetType() - { - return typeof(MyForms); - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override string ToString() - { - return base.ToString(); - } - } - - private static ThreadSafeObjectProvider m_MyFormsObjectProvider = new ThreadSafeObjectProvider(); - - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped IfDirectiveTrivia */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default; - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElseDirectiveTrivia */ - [DebuggerHidden()] - get - { - if (m_ThreadStaticValue is null) - m_ThreadStaticValue = new T(); - return m_ThreadStaticValue; - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElseDirectiveTrivia */ - [System.Runtime.CompilerServices.CompilerGenerated()] - [ThreadStatic()] - private static T m_ThreadStaticValue; - /* TODO ERROR: Skipped EndIfDirectiveTrivia */ - } - } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia */ \ No newline at end of file diff --git a/imagecatalog/My Project/Settings.Designer.cs b/imagecatalog/My Project/Settings.Designer.cs deleted file mode 100644 index 21716e7..0000000 --- a/imagecatalog/My Project/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ImageCatalog.My { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/imagecatalog/My Project/Settings.Designer.vb b/imagecatalog/My Project/Settings.Designer.vb deleted file mode 100644 index 75ffa5f..0000000 --- a/imagecatalog/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict Off -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.ImageCatalog.My.MySettings - Get - Return Global.ImageCatalog.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/imagecatalog/My Project/Settings.settings b/imagecatalog/My Project/Settings.settings deleted file mode 100644 index 392df0a..0000000 --- a/imagecatalog/My Project/Settings.settings +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/imagecatalog/My Project/app.manifest b/imagecatalog/My Project/app.manifest deleted file mode 100644 index 4c249cd..0000000 --- a/imagecatalog/My Project/app.manifest +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/imagecatalog/Program.cs b/imagecatalog/Program.cs new file mode 100644 index 0000000..9d7da28 --- /dev/null +++ b/imagecatalog/Program.cs @@ -0,0 +1,34 @@ +using ImageCatalog; +using ImageCatalog_2.Services; +using Microsoft.Extensions.DependencyInjection; + +namespace ImageCatalog_2 +{ + static class Program + { + public static IServiceProvider ServiceProvider { get; private set; } + [STAThread] + static void Main() + { + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + var serviceCollection = new ServiceCollection(); + ConfigureServices(serviceCollection); + + ServiceProvider = serviceCollection.BuildServiceProvider(); + + Application.Run(ServiceProvider.GetRequiredService()); + } + + private static void ConfigureServices(ServiceCollection services) + { + // Register your services here + services.AddTransient(); + + // Register your forms + services.AddTransient(); + } + } +} diff --git a/imagecatalog/Services/TestService.cs b/imagecatalog/Services/TestService.cs new file mode 100644 index 0000000..c7bcd1d --- /dev/null +++ b/imagecatalog/Services/TestService.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ImageCatalog_2.Services +{ + public interface ITestService + { + + } + + public class TestService : ITestService + { + + } +}