2024-02-21 01:42:28 +04:00
|
|
|
|
using AircraftPlantListImplement.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace AircraftPlantListImplement
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Класс для хранения списков классов-моделей (паттерн Singleton)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class DataListSingleton
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Ссылка на класс
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static DataListSingleton? _instance;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список классов-моделей компонентов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Component> Components { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список классов-моделей заказов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Order> Orders { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список классов-моделей изделий
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Plane> Planes { get; set; }
|
|
|
|
|
|
2024-04-07 00:02:29 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список классов-моделей клиентов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Client> Clients { get; set; }
|
|
|
|
|
|
2024-04-20 22:35:38 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список классов-моделей исполнителей
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Implementer> Implementers { get; set; }
|
|
|
|
|
|
2024-02-21 01:42:28 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Конструктор
|
|
|
|
|
/// </summary>
|
|
|
|
|
private DataListSingleton()
|
|
|
|
|
{
|
|
|
|
|
Components = new List<Component>();
|
|
|
|
|
Orders = new List<Order>();
|
|
|
|
|
Planes = new List<Plane>();
|
2024-04-07 00:02:29 +04:00
|
|
|
|
Clients = new List<Client>();
|
2024-04-20 22:35:38 +04:00
|
|
|
|
Implementers = new List<Implementer>();
|
2024-02-21 01:42:28 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получить ссылку на класс
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static DataListSingleton GetInstance()
|
|
|
|
|
{
|
|
|
|
|
if (_instance == null)
|
|
|
|
|
{
|
|
|
|
|
_instance = new DataListSingleton();
|
|
|
|
|
}
|
|
|
|
|
return _instance;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|