From d7ac4d76270d685a1972bc73005e40cf7ef2545b Mon Sep 17 00:00:00 2001 From: Timourka Date: Sun, 19 May 2024 00:34:32 +0500 Subject: [PATCH] 8 laba complicated --- .../AutomobilePlantBusinessLogic.csproj | 4 ++ .../BusinessLogicExtension.cs | 36 ++++++++++++++ .../Attributes/ColumnAttribute.cs | 4 +- .../BindingModels/MessageInfoBindingModel.cs | 1 - .../DI/DependencyManager.cs | 8 ++-- .../DI/IBusinessLogicExtension.cs | 9 ++++ .../DI/ServiceProviderLoader.cs | 39 +++++++++++++++ .../ViewModels/ShopViewModel.cs | 36 +++++++------- .../DatabaseImplementationExtension.cs | 1 + .../Models/Shop.cs | 29 ++++++----- .../FileImplementationExtension.cs | 1 + .../Models/Shop.cs | 29 ++++++----- .../ListImplementationExtension.cs | 1 + .../DataGridViewExtension.cs | 1 + .../AutomobilePlantView/FormMails.cs | 12 ++--- .../AutomobilePlantView/FormMain.Designer.cs | 2 +- .../AutomobilePlantView/FormMain.cs | 35 ++++---------- .../AutomobilePlantView/FormShops.cs | 48 +++++-------------- .../AutomobilePlantView/Program.cs | 15 ------ 19 files changed, 176 insertions(+), 135 deletions(-) create mode 100644 AutomobilePlant/AutomobilePlantBusinessLogic/BusinessLogicExtension.cs create mode 100644 AutomobilePlant/AutomobilePlantContracts/DI/IBusinessLogicExtension.cs diff --git a/AutomobilePlant/AutomobilePlantBusinessLogic/AutomobilePlantBusinessLogic.csproj b/AutomobilePlant/AutomobilePlantBusinessLogic/AutomobilePlantBusinessLogic.csproj index a2b3c9f..75b5648 100644 --- a/AutomobilePlant/AutomobilePlantBusinessLogic/AutomobilePlantBusinessLogic.csproj +++ b/AutomobilePlant/AutomobilePlantBusinessLogic/AutomobilePlantBusinessLogic.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/AutomobilePlant/AutomobilePlantBusinessLogic/BusinessLogicExtension.cs b/AutomobilePlant/AutomobilePlantBusinessLogic/BusinessLogicExtension.cs new file mode 100644 index 0000000..83e3c84 --- /dev/null +++ b/AutomobilePlant/AutomobilePlantBusinessLogic/BusinessLogicExtension.cs @@ -0,0 +1,36 @@ +using AutomobilePlantBusinessLogic.BusinessLogics; +using AutomobilePlantBusinessLogic.MailWorker; +using AutomobilePlantBusinessLogic.OfficePackage.Implements; +using AutomobilePlantBusinessLogic.OfficePackage; +using AutomobilePlantContracts.BusinessLogicsContracts; +using AutomobilePlantContracts.DI; + +namespace AutomobilePlantBusinessLogic +{ + public class BusinessLogicExtension : IBusinessLogicExtension + { + public int Priority => 0; + + public void RegisterServices() + { + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + + + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(true); + + DependencyManager.Instance.RegisterType(); + } + } +} diff --git a/AutomobilePlant/AutomobilePlantContracts/Attributes/ColumnAttribute.cs b/AutomobilePlant/AutomobilePlantContracts/Attributes/ColumnAttribute.cs index 35a910c..ce25d7d 100644 --- a/AutomobilePlant/AutomobilePlantContracts/Attributes/ColumnAttribute.cs +++ b/AutomobilePlant/AutomobilePlantContracts/Attributes/ColumnAttribute.cs @@ -3,18 +3,20 @@ [AttributeUsage(AttributeTargets.Property)] public class ColumnAttribute : Attribute { - public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false) + public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false, string format = "") { Title = title; Visible = visible; Width = width; GridViewAutoSize = gridViewAutoSize; IsUseAutoSize = isUseAutoSize; + Format = format; } public string Title { get; private set; } public bool Visible { get; private set; } public int Width { get; private set; } public GridViewAutoSize GridViewAutoSize { get; private set; } public bool IsUseAutoSize { get; private set; } + public string Format { get; private set; } } } diff --git a/AutomobilePlant/AutomobilePlantContracts/BindingModels/MessageInfoBindingModel.cs b/AutomobilePlant/AutomobilePlantContracts/BindingModels/MessageInfoBindingModel.cs index ecc1a9c..51838d9 100644 --- a/AutomobilePlant/AutomobilePlantContracts/BindingModels/MessageInfoBindingModel.cs +++ b/AutomobilePlant/AutomobilePlantContracts/BindingModels/MessageInfoBindingModel.cs @@ -17,7 +17,6 @@ namespace AutomobilePlantContracts.BindingModels public string Body { get; set; } = string.Empty; public bool IsReaded { get; set; } public string? Reply { get; set; } - } public int Id => throw new NotImplementedException(); } diff --git a/AutomobilePlant/AutomobilePlantContracts/DI/DependencyManager.cs b/AutomobilePlant/AutomobilePlantContracts/DI/DependencyManager.cs index 71eb0f3..2718569 100644 --- a/AutomobilePlant/AutomobilePlantContracts/DI/DependencyManager.cs +++ b/AutomobilePlant/AutomobilePlantContracts/DI/DependencyManager.cs @@ -25,13 +25,15 @@ namespace AutomobilePlantContracts.DI /// public static void InitDependency() { - var ext = ServiceProviderLoader.GetImplementationExtensions(); - if (ext == null) + var extDB = ServiceProviderLoader.GetImplementationExtensions(); + var extBL = ServiceProviderLoader.GetBusinessLogicExtensions(); + if (extDB == null || extBL == null) { throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям"); } // регистрируем зависимости - ext.RegisterServices(); + extDB.RegisterServices(); + extBL.RegisterServices(); } /// diff --git a/AutomobilePlant/AutomobilePlantContracts/DI/IBusinessLogicExtension.cs b/AutomobilePlant/AutomobilePlantContracts/DI/IBusinessLogicExtension.cs new file mode 100644 index 0000000..448896b --- /dev/null +++ b/AutomobilePlant/AutomobilePlantContracts/DI/IBusinessLogicExtension.cs @@ -0,0 +1,9 @@ +namespace AutomobilePlantContracts.DI +{ + public interface IBusinessLogicExtension + { + public int Priority { get; } + + public void RegisterServices(); + } +} diff --git a/AutomobilePlant/AutomobilePlantContracts/DI/ServiceProviderLoader.cs b/AutomobilePlant/AutomobilePlantContracts/DI/ServiceProviderLoader.cs index b586666..8192ce4 100644 --- a/AutomobilePlant/AutomobilePlantContracts/DI/ServiceProviderLoader.cs +++ b/AutomobilePlant/AutomobilePlantContracts/DI/ServiceProviderLoader.cs @@ -40,6 +40,35 @@ namespace AutomobilePlantContracts.DI return source; } + public static IBusinessLogicExtension? GetBusinessLogicExtensions() + { + IBusinessLogicExtension? source = null; + var files = Directory.GetFiles(TryGetBusinessLogicExtensionsFolder(), "*.dll", SearchOption.AllDirectories); + foreach (var file in files.Distinct()) + { + Assembly asm = Assembly.LoadFrom(file); + foreach (var t in asm.GetExportedTypes()) + { + if (t.IsClass && typeof(IBusinessLogicExtension).IsAssignableFrom(t)) + { + if (source == null) + { + source = (IBusinessLogicExtension)Activator.CreateInstance(t)!; + } + else + { + var newSource = (IBusinessLogicExtension)Activator.CreateInstance(t)!; + if (newSource.Priority > source.Priority) + { + source = newSource; + } + } + } + } + } + return source; + } + private static string TryGetImplementationExtensionsFolder() { var directory = new DirectoryInfo(Directory.GetCurrentDirectory()); @@ -49,5 +78,15 @@ namespace AutomobilePlantContracts.DI } return $"{directory?.FullName}\\ImplementationExtensions"; } + + private static string TryGetBusinessLogicExtensionsFolder() + { + var directory = new DirectoryInfo(Directory.GetCurrentDirectory()); + while (directory != null && !directory.GetDirectories("BusinessLogicExtensions", SearchOption.AllDirectories).Any(x => x.Name == "BusinessLogicExtensions")) + { + directory = directory.Parent; + } + return $"{directory?.FullName}\\BusinessLogicExtensions"; + } } } diff --git a/AutomobilePlant/AutomobilePlantContracts/ViewModels/ShopViewModel.cs b/AutomobilePlant/AutomobilePlantContracts/ViewModels/ShopViewModel.cs index dec4a2d..6f85f4c 100644 --- a/AutomobilePlant/AutomobilePlantContracts/ViewModels/ShopViewModel.cs +++ b/AutomobilePlant/AutomobilePlantContracts/ViewModels/ShopViewModel.cs @@ -1,31 +1,29 @@ -using AutomobilePlantDataModels.Models; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using AutomobilePlantContracts.Attributes; +using AutomobilePlantDataModels.Models; namespace AutomobilePlantContracts.ViewModels { public class ShopViewModel : IShopModel - { - public int Id { get; set; } + { + [Column(visible: false)] + public int Id { get; set; } - [DisplayName("Shop's name")] - public string Name { get; set; } = string.Empty; + [Column(title: "Shop's name", width: 200)] + public string Name { get; set; } = string.Empty; - [DisplayName("Address")] - public string Address { get; set; } = string.Empty; + [Column(title: "Address", width: 100)] + public string Address { get; set; } = string.Empty; - [DisplayName("Maximum cars' count in shop")] - public int MaxCountCars { get; set; } + [Column(title: "Maximum cars' count in shop", width: 100)] + public int MaxCountCars { get; set; } - [DisplayName("Opening date")] - public DateTime OpeningDate { get; set; } + [Column(title: "Opening date", width: 100, format: "d")] + public DateTime OpeningDate { get; set; } - public Dictionary ShopCars { get; set; } = new(); + [Column(visible: false)] + public Dictionary ShopCars { get; set; } = new(); - public List>? CarAndCount { get; set; } = new(); + [Column(visible: false)] + public List>? CarAndCount { get; set; } = new(); } } diff --git a/AutomobilePlant/AutomobilePlantDatabaseImplement/DatabaseImplementationExtension.cs b/AutomobilePlant/AutomobilePlantDatabaseImplement/DatabaseImplementationExtension.cs index edad610..487ccc8 100644 --- a/AutomobilePlant/AutomobilePlantDatabaseImplement/DatabaseImplementationExtension.cs +++ b/AutomobilePlant/AutomobilePlantDatabaseImplement/DatabaseImplementationExtension.cs @@ -17,6 +17,7 @@ namespace AutomobilePlantDatabaseImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); } } } diff --git a/AutomobilePlant/AutomobilePlantDatabaseImplement/Models/Shop.cs b/AutomobilePlant/AutomobilePlantDatabaseImplement/Models/Shop.cs index c37fc3f..32557c9 100644 --- a/AutomobilePlant/AutomobilePlantDatabaseImplement/Models/Shop.cs +++ b/AutomobilePlant/AutomobilePlantDatabaseImplement/Models/Shop.cs @@ -1,27 +1,28 @@ using AutomobilePlantContracts.BindingModels; using AutomobilePlantContracts.ViewModels; using AutomobilePlantDataModels.Models; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Runtime.Serialization; namespace AutomobilePlantDatabaseImplement.Models { - public class Shop : IShopModel - { - public int Id { get; set; } + [DataContract] + public class Shop : IShopModel + { + [DataMember] + public int Id { get; set; } - [Required] + [DataMember] + [Required] public string Name { get; set; } = string.Empty; - [Required] + [DataMember] + [Required] public string Address { get; set; } = string.Empty; - [Required] + [DataMember] + [Required] public DateTime OpeningDate { get; set; } [ForeignKey("ShopId")] @@ -29,7 +30,8 @@ namespace AutomobilePlantDatabaseImplement.Models private Dictionary? _shopCars = null; - [NotMapped] + [DataMember] + [NotMapped] public Dictionary ShopCars { get @@ -42,7 +44,8 @@ namespace AutomobilePlantDatabaseImplement.Models } } - [Required] + [DataMember] + [Required] public int MaxCountCars { get; set; } public static Shop Create(AutomobilePlantDatabase context, ShopBindingModel model) diff --git a/AutomobilePlant/AutomobilePlantFileImplement/FileImplementationExtension.cs b/AutomobilePlant/AutomobilePlantFileImplement/FileImplementationExtension.cs index 0fad965..db0ded9 100644 --- a/AutomobilePlant/AutomobilePlantFileImplement/FileImplementationExtension.cs +++ b/AutomobilePlant/AutomobilePlantFileImplement/FileImplementationExtension.cs @@ -17,6 +17,7 @@ namespace AutomobilePlantFileImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); } } } diff --git a/AutomobilePlant/AutomobilePlantFileImplement/Models/Shop.cs b/AutomobilePlant/AutomobilePlantFileImplement/Models/Shop.cs index 172b6c8..8e05555 100644 --- a/AutomobilePlant/AutomobilePlantFileImplement/Models/Shop.cs +++ b/AutomobilePlant/AutomobilePlantFileImplement/Models/Shop.cs @@ -1,26 +1,29 @@ using AutomobilePlantContracts.BindingModels; using AutomobilePlantContracts.ViewModels; using AutomobilePlantDataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Runtime.Serialization; using System.Xml.Linq; namespace AutomobilePlantFileImplement.Models { - public class Shop : IShopModel - { - public int Id { get; private set; } - public string Name { get; private set; } = string.Empty; - public string Address { get; private set; } = string.Empty; - public int MaxCountCars { get; private set; } - public DateTime OpeningDate { get; private set; } + [DataContract] + public class Shop : IShopModel + { + [DataMember] + public int Id { get; private set; } + [DataMember] + public string Name { get; private set; } = string.Empty; + [DataMember] + public string Address { get; private set; } = string.Empty; + [DataMember] + public int MaxCountCars { get; private set; } + [DataMember] + public DateTime OpeningDate { get; private set; } public Dictionary Cars { get; private set; } = new(); private Dictionary? _shopCars = null; - public Dictionary ShopCars + [DataMember] + public Dictionary ShopCars { get { diff --git a/AutomobilePlant/AutomobilePlantListImplement/ListImplementationExtension.cs b/AutomobilePlant/AutomobilePlantListImplement/ListImplementationExtension.cs index 293534d..c50fd08 100644 --- a/AutomobilePlant/AutomobilePlantListImplement/ListImplementationExtension.cs +++ b/AutomobilePlant/AutomobilePlantListImplement/ListImplementationExtension.cs @@ -17,6 +17,7 @@ namespace AutomobilePlantListImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); } } } diff --git a/AutomobilePlant/AutomobilePlantView/DataGridViewExtension.cs b/AutomobilePlant/AutomobilePlantView/DataGridViewExtension.cs index b8662a1..f4cf4b3 100644 --- a/AutomobilePlant/AutomobilePlantView/DataGridViewExtension.cs +++ b/AutomobilePlant/AutomobilePlantView/DataGridViewExtension.cs @@ -38,6 +38,7 @@ namespace AutomobilePlantView { column.Width = columnAttr.Width; } + column.DefaultCellStyle.Format = columnAttr.Format; } } } diff --git a/AutomobilePlant/AutomobilePlantView/FormMails.cs b/AutomobilePlant/AutomobilePlantView/FormMails.cs index 0f2ea33..eb9823b 100644 --- a/AutomobilePlant/AutomobilePlantView/FormMails.cs +++ b/AutomobilePlant/AutomobilePlantView/FormMails.cs @@ -1,4 +1,5 @@ using AutomobilePlantContracts.BusinessLogicsContracts; +using AutomobilePlantContracts.DI; using Microsoft.Extensions.Logging; namespace AutomobilePlantView @@ -49,13 +50,10 @@ namespace AutomobilePlantView { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormMail)); - if (service is FormMail form) - { - form.MessageId = (string)(dataGridView.SelectedRows[0].Cells["MessageId"].Value); - form.ShowDialog(); - LoadData(); - } + var form = DependencyManager.Instance.Resolve(); + form.MessageId = (string)(dataGridView.SelectedRows[0].Cells["MessageId"].Value); + form.ShowDialog(); + LoadData(); } } } diff --git a/AutomobilePlant/AutomobilePlantView/FormMain.Designer.cs b/AutomobilePlant/AutomobilePlantView/FormMain.Designer.cs index 7a40c14..5728240 100644 --- a/AutomobilePlant/AutomobilePlantView/FormMain.Designer.cs +++ b/AutomobilePlant/AutomobilePlantView/FormMain.Designer.cs @@ -87,7 +87,7 @@ // // toolStripMenuItemCatalogs // - toolStripMenuItemCatalogs.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItemComponents, toolStripMenuItemCars, clientsToolStripMenuItem, implementersToolStripMenuItem, mailsToolStripMenuItem }); + toolStripMenuItemCatalogs.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItemComponents, toolStripMenuItemCars, clientsToolStripMenuItem, shopsToolStripMenuItem, shopsSupplyToolStripMenuItem, sellCarsToolStripMenuItem, implementersToolStripMenuItem, mailsToolStripMenuItem }); toolStripMenuItemCatalogs.Name = "toolStripMenuItemCatalogs"; toolStripMenuItemCatalogs.Size = new Size(65, 20); toolStripMenuItemCatalogs.Text = "Catalogs"; diff --git a/AutomobilePlant/AutomobilePlantView/FormMain.cs b/AutomobilePlant/AutomobilePlantView/FormMain.cs index d90e20d..b95a9f0 100644 --- a/AutomobilePlant/AutomobilePlantView/FormMain.cs +++ b/AutomobilePlant/AutomobilePlantView/FormMain.cs @@ -53,20 +53,14 @@ namespace AutomobilePlantView private void shopsToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormShops)); - if (service is FormShops form) - { - form.ShowDialog(); - } + var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); } private void shopsSupplyToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormShopSupply)); - if (service is FormShopSupply form) - { - form.ShowDialog(); - } + var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); } private void clientsToolStripMenuItem_Click(object sender, EventArgs e) @@ -114,11 +108,8 @@ namespace AutomobilePlantView private void sellCarsToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormShopSell)); - if (service is FormShopSell form) - { - form.ShowDialog(); - } + var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); } private void shopsListToolStripMenuItem_Click(object sender, EventArgs e) @@ -136,11 +127,8 @@ namespace AutomobilePlantView private void storeCongestionToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormReportShopCars)); - if (service is FormReportShopCars form) - { - form.ShowDialog(); - } + var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); } private void startWorkingsToolStripMenuItem_Click(object sender, EventArgs e) @@ -151,11 +139,8 @@ namespace AutomobilePlantView private void listOdOrdersByDatesToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormReportDateOrders)); - if (service is FormReportDateOrders form) - { - form.ShowDialog(); - } + var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); } private void createBackupToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/AutomobilePlant/AutomobilePlantView/FormShops.cs b/AutomobilePlant/AutomobilePlantView/FormShops.cs index b440af7..33ff8f6 100644 --- a/AutomobilePlant/AutomobilePlantView/FormShops.cs +++ b/AutomobilePlant/AutomobilePlantView/FormShops.cs @@ -1,15 +1,7 @@ using AutomobilePlantContracts.BindingModels; using AutomobilePlantContracts.BusinessLogicsContracts; +using AutomobilePlantContracts.DI; using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace AutomobilePlantView { @@ -33,18 +25,9 @@ namespace AutomobilePlantView private void LoadData() { try - { - var list = _logic.ReadList(null); - - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["Id"].Visible = false; - dataGridView.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - dataGridView.Columns["ShopCars"].Visible = false; - } - - _logger.LogInformation("Загрузка магазинов"); + { + dataGridView.FillAndConfigGrid(_logic.ReadList(null)); + _logger.LogInformation("Загрузка магазинов"); } catch (Exception ex) @@ -61,14 +44,10 @@ namespace AutomobilePlantView private void buttonAdd_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormShop)); - - if (service is FormShop form) + var form = DependencyManager.Instance.Resolve(); + if (form.ShowDialog() == DialogResult.OK) { - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } @@ -76,16 +55,11 @@ namespace AutomobilePlantView { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormShop)); - - if (service is FormShop form) + var form = DependencyManager.Instance.Resolve(); + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + if (form.ShowDialog() == DialogResult.OK) { - form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } } diff --git a/AutomobilePlant/AutomobilePlantView/Program.cs b/AutomobilePlant/AutomobilePlantView/Program.cs index 91cf62f..2ced5d4 100644 --- a/AutomobilePlant/AutomobilePlantView/Program.cs +++ b/AutomobilePlant/AutomobilePlantView/Program.cs @@ -59,21 +59,6 @@ namespace AutomobilePlantView option.SetMinimumLevel(LogLevel.Information); option.AddNLog("nlog.config"); }); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType();