Lab04: create plugins convertion library

This commit is contained in:
abazov73 2023-11-30 19:37:39 +04:00
parent 69b21488e6
commit 0b515dc8c4
6 changed files with 114 additions and 5 deletions

2
.gitignore vendored
View File

@ -4,6 +4,8 @@
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
*.dll
# User-specific files
*.rsuser
*.suo

View File

@ -7,15 +7,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbazovAppView", "AbazovAppV
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbazovViewComponents", "AbazovViewComponents\AbazovViewComponents.csproj", "{070AAA71-3C9B-4E19-A89D-83372C630C6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountsApp", "AccountsApp\AccountsApp.csproj", "{AFCB57A0-4332-4C32-9FB1-60548F7D7276}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountsApp", "AccountsApp\AccountsApp.csproj", "{AFCB57A0-4332-4C32-9FB1-60548F7D7276}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountsDataModels", "AccountsDataModels\AccountsDataModels.csproj", "{31DEDC68-889D-427B-ADDE-60F2ADE2C596}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountsDataModels", "AccountsDataModels\AccountsDataModels.csproj", "{31DEDC68-889D-427B-ADDE-60F2ADE2C596}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountsContracts", "AccountsContracts\AccountsContracts.csproj", "{CDA8B86A-9645-4D83-92D0-C8D2D85B734F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountsContracts", "AccountsContracts\AccountsContracts.csproj", "{CDA8B86A-9645-4D83-92D0-C8D2D85B734F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountsBusinessLogic", "AccountsBusinessLogic\AccountsBusinessLogic.csproj", "{D98A5D9F-A491-4A4B-A4A3-B1F388BAD18D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountsBusinessLogic", "AccountsBusinessLogic\AccountsBusinessLogic.csproj", "{D98A5D9F-A491-4A4B-A4A3-B1F388BAD18D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountsDataBaseImplement", "AccountsDataBaseImplement\AccountsDataBaseImplement.csproj", "{ACF95C0D-CEB3-41B9-8B7F-149BEEEE53CE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountsDataBaseImplement", "AccountsDataBaseImplement\AccountsDataBaseImplement.csproj", "{ACF95C0D-CEB3-41B9-8B7F-149BEEEE53CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginsConventionLibrary", "PluginsConventionLibrary\PluginsConventionLibrary.csproj", "{B97362C6-7FB3-4696-BE00-7E42C4E40274}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -51,6 +53,10 @@ Global
{ACF95C0D-CEB3-41B9-8B7F-149BEEEE53CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACF95C0D-CEB3-41B9-8B7F-149BEEEE53CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACF95C0D-CEB3-41B9-8B7F-149BEEEE53CE}.Release|Any CPU.Build.0 = Release|Any CPU
{B97362C6-7FB3-4696-BE00-7E42C4E40274}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B97362C6-7FB3-4696-BE00-7E42C4E40274}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B97362C6-7FB3-4696-BE00-7E42C4E40274}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B97362C6-7FB3-4696-BE00-7E42C4E40274}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginsConventionLibrary
{
public interface IPluginsConvention
{
/// <summary>
/// Название плагина
/// </summary>
string PluginName { get; }
/// <summary>
/// Получение контрола для вывода набора данных
/// </summary>
UserControl GetControl { get; }
/// <summary>
/// Получение элемента, выбранного в контроле
/// </summary>
PluginsConventionElement GetElement { get; }
/// <summary>
/// Получение формы для создания/редактирования объекта
/// </summary>
/// <param name="element"></param>
/// <returns></returns>
Form GetForm(PluginsConventionElement element);
/// <summary>
/// Получение формы для работы со справочником
/// </summary>
/// <returns></returns>
Form GetThesaurus();
/// <summary>
/// Удаление элемента
/// </summary>
/// <param name="element"></param>
/// <returns></returns>
bool DeleteElement(PluginsConventionElement element);
/// <summary>
/// Обновление набора данных в контроле
/// </summary>
void ReloadData();
/// <summary>
/// Создание простого документа
/// </summary>
/// <param name="saveDocument"></param>
/// <returns></returns>
bool CreateSimpleDocument(PluginsConventionSaveDocument
saveDocument);
/// <summary>
/// Создание простого документа
/// </summary>
/// <param name="saveDocument"></param>
/// <returns></returns>
bool CreateTableDocument(PluginsConventionSaveDocument saveDocument);
/// <summary>
/// Создание документа с диаграммой
/// </summary>
/// <param name="saveDocument"></param>
/// <returns></returns>
bool CreateChartDocument(PluginsConventionSaveDocument saveDocument);
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginsConventionLibrary
{
public class PluginsConventionElement
{
public Guid Id { get; set; }
}
}

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginsConventionLibrary
{
public class PluginsConventionSaveDocument
{
public string FileName { get; set; }
}
}