лаб4
This commit is contained in:
parent
32dfbe5764
commit
e7a226e28c
@ -25,6 +25,15 @@
|
|||||||
<ProjectReference Include="..\BusinessLogic\BusinessLogic.csproj" />
|
<ProjectReference Include="..\BusinessLogic\BusinessLogic.csproj" />
|
||||||
<ProjectReference Include="..\Contracts\Contracts.csproj" />
|
<ProjectReference Include="..\Contracts\Contracts.csproj" />
|
||||||
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
|
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
|
||||||
|
<ProjectReference Include="..\PluginsConventionLibrary\PluginsConventionLibrary.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="CreatePluginsFolder" BeforeTargets="PreBuildEvent" Condition="!Exists('$(SolutionDir)Plugins')">
|
||||||
|
<MakeDir Directories="$(SolutionDir)Plugins" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CopyPlugins" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="copy /Y "$(TargetDir)*.dll" "$(SolutionDir)Plugins\*.dll"" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
213
Library/PluginsConvention.cs
Normal file
213
Library/PluginsConvention.cs
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
using BusinessLogic;
|
||||||
|
using ComponentsLibraryNet60.DocumentWithChart;
|
||||||
|
using ComponentsLibraryNet60.DocumentWithTable;
|
||||||
|
using ComponentsLibraryNet60.Models;
|
||||||
|
using Contracts.BindingModels;
|
||||||
|
using Contracts.BusinessLogicContracts;
|
||||||
|
using Contracts.SearchModels;
|
||||||
|
using Contracts.ViewModels;
|
||||||
|
using CustomComponents;
|
||||||
|
using DatabaseImplement.Implements;
|
||||||
|
using KOP_Labs;
|
||||||
|
using KOP_Labs.Classes;
|
||||||
|
using KOP_Labs.NonVisualComponents;
|
||||||
|
using PluginsConventionLibrary;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ViewComponents.NotVisualComponents;
|
||||||
|
|
||||||
|
namespace Library
|
||||||
|
{
|
||||||
|
public class PluginsConvention : IPluginsConvention
|
||||||
|
{
|
||||||
|
private readonly IBookLogic _bookLogic;
|
||||||
|
private readonly IAuthorLogic _authorLogic;
|
||||||
|
private readonly KOP_Labs.TableComponent _controlDataTable;
|
||||||
|
private readonly PdfImages _pdfImagesComponent;
|
||||||
|
private readonly ComponentDocumentWithTableHeaderRowExcel _excelTableComponent;
|
||||||
|
private readonly WordHistogramm _chartBar;
|
||||||
|
public string PluginName { get; set; } = "LabWork_03_plugin";
|
||||||
|
|
||||||
|
public UserControl GetControl
|
||||||
|
{
|
||||||
|
get { return _controlDataTable; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public PluginsConvention()
|
||||||
|
{
|
||||||
|
_bookLogic = new BookLogic(new BookStorage());
|
||||||
|
_authorLogic = new AuthorLogic(new AuthorStorage());
|
||||||
|
_pdfImagesComponent = new();
|
||||||
|
_excelTableComponent = new();
|
||||||
|
_chartBar = new();
|
||||||
|
_controlDataTable = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PluginsConventionElement GetElement
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int Id = _controlDataTable.GetSelectedObject<BookSearchModel>()!.Id;
|
||||||
|
byte[] bytes = new byte[16];
|
||||||
|
BitConverter.GetBytes(Id).CopyTo(bytes, 0);
|
||||||
|
Guid guid = new Guid(bytes);
|
||||||
|
return new PluginsConventionElement() { Id = guid };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Form GetForm(PluginsConventionElement element)
|
||||||
|
{
|
||||||
|
if (element == null)
|
||||||
|
{
|
||||||
|
return new FormBook(_bookLogic, _authorLogic);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FormBook form = new FormBook(_bookLogic, _authorLogic);
|
||||||
|
form.Id = element.Id.GetHashCode();
|
||||||
|
return form;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Form GetThesaurus()
|
||||||
|
{
|
||||||
|
return new FormAuthor(_authorLogic);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool DeleteElement(PluginsConventionElement element)
|
||||||
|
{
|
||||||
|
_bookLogic.Delete(
|
||||||
|
new BookBindingModel { Id = element.Id.GetHashCode() }
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReloadData()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var list = _bookLogic.Read(null);
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
_controlDataTable.ClearRows();
|
||||||
|
|
||||||
|
_controlDataTable.TableConfiguration(5, new List<TableParameters>
|
||||||
|
{
|
||||||
|
new TableParameters("Id", 80, false, "Id"),
|
||||||
|
new TableParameters("Название", 100, true, "Name"),
|
||||||
|
new TableParameters("Автор", 180, true, "Author"),
|
||||||
|
new TableParameters("Обложка", 80, false, "PicturePath"),
|
||||||
|
new TableParameters("Дата издания", 150, true, "PublicationDate")
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var row in list)
|
||||||
|
{
|
||||||
|
_controlDataTable.AddRow(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(
|
||||||
|
ex.Message,
|
||||||
|
"Ошибка",
|
||||||
|
MessageBoxButtons.OK,
|
||||||
|
MessageBoxIcon.Error
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CreateSimpleDocument(PluginsConventionSaveDocument saveDocument)
|
||||||
|
{
|
||||||
|
List<string> images = new List<string>();
|
||||||
|
var list = _bookLogic.Read(null);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
images.Add(item.PicturePath);
|
||||||
|
}
|
||||||
|
string[] imagesArray = images.ToArray();
|
||||||
|
|
||||||
|
_pdfImagesComponent.CreatePdfDoc(new ImagesForPDF(saveDocument.FileName, "Иллюстрации книг", imagesArray));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка");
|
||||||
|
}
|
||||||
|
MessageBox.Show("Документ создан");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CreateTableDocument(PluginsConventionSaveDocument saveDocument)
|
||||||
|
{
|
||||||
|
List<(int Column, int Row)> width = new List<(int, int)>() { (30, 0), (30, 0), (30, 0), (30, 0) };
|
||||||
|
List<(int StartIndex, int Count)> column_union = new List<(int, int)>() { (1, 2) };
|
||||||
|
List<(int ColumnIndex, int RowIndex, string Header, string PropertyName)> headers =
|
||||||
|
new List<(int ColumnIndex, int RowIndex, string Header, string PropertyName)> {
|
||||||
|
(0,0, "Идентификатор", "Id"),
|
||||||
|
(1,0,"Книга", ""),
|
||||||
|
(1,1,"Название", "Name"),
|
||||||
|
(2,1,"Автор","Author"),
|
||||||
|
(3,0,"Дата публикации", "PublicationDate")
|
||||||
|
};
|
||||||
|
|
||||||
|
var list = _bookLogic.Read(null);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_excelTableComponent.CreateDoc(new ComponentDocumentWithTableHeaderDataConfig<BookViewModel>()
|
||||||
|
{
|
||||||
|
Data = list,
|
||||||
|
UseUnion = true,
|
||||||
|
ColumnsRowsWidth = width,
|
||||||
|
ColumnUnion = column_union,
|
||||||
|
Headers = headers,
|
||||||
|
FilePath = saveDocument.FileName,
|
||||||
|
Header = "Отчёт по книгам"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка");
|
||||||
|
}
|
||||||
|
MessageBox.Show("Документ создан");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CreateChartDocument(PluginsConventionSaveDocument saveDocument)
|
||||||
|
{
|
||||||
|
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||||
|
|
||||||
|
List<DataHistogramm> dataHistogramms = new List<DataHistogramm>();
|
||||||
|
|
||||||
|
var list_author = _authorLogic.Read(null);
|
||||||
|
var list_book = _bookLogic.Read(null);
|
||||||
|
foreach (var nm in list_author)
|
||||||
|
{
|
||||||
|
int bk_count = 0;
|
||||||
|
foreach (var bk in list_book)
|
||||||
|
if (bk.Author.Contains(nm.FIO)) bk_count++;
|
||||||
|
dataHistogramms.Add(new DataHistogramm(nm.FIO, bk_count));
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_chartBar.CreateHistogramm(new MyHistogramm(saveDocument.FileName, "Гистограмма", "Авторы и их книги", EnumLegends.Top, dataHistogramms));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка");
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.Show("Документ создан");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
233
LibraryByPlugins/FormMain.Designer.cs
generated
Normal file
233
LibraryByPlugins/FormMain.Designer.cs
generated
Normal file
@ -0,0 +1,233 @@
|
|||||||
|
namespace LibraryByPlugins
|
||||||
|
{
|
||||||
|
partial class FormMain
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.ControlsStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.ActionsToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.DocsToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.SimpleDocToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.TableDocToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.ChartDocToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.panelControl = new System.Windows.Forms.Panel();
|
||||||
|
this.ThesaurusToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.AddElementToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.UpdElementToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.DelElementToolStripMenuItem = new
|
||||||
|
System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.menuStrip.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// menuStrip
|
||||||
|
//
|
||||||
|
this.menuStrip.Items.AddRange(new
|
||||||
|
System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.ControlsStripMenuItem,
|
||||||
|
this.ActionsToolStripMenuItem,
|
||||||
|
this.DocsToolStripMenuItem});
|
||||||
|
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.menuStrip.Name = "menuStrip";
|
||||||
|
this.menuStrip.Size = new System.Drawing.Size(800, 24);
|
||||||
|
this.menuStrip.TabIndex = 0;
|
||||||
|
this.menuStrip.Text = "Меню";
|
||||||
|
//
|
||||||
|
// ControlsStripMenuItem
|
||||||
|
//
|
||||||
|
this.ControlsStripMenuItem.Name = "ControlsStripMenuItem";
|
||||||
|
this.ControlsStripMenuItem.Size = new System.Drawing.Size(94,
|
||||||
|
20);
|
||||||
|
this.ControlsStripMenuItem.Text = "Компоненты";
|
||||||
|
//
|
||||||
|
// ActionsToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.ActionsToolStripMenuItem.DropDownItems.AddRange(new
|
||||||
|
System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.ThesaurusToolStripMenuItem,
|
||||||
|
this.AddElementToolStripMenuItem,
|
||||||
|
this.UpdElementToolStripMenuItem,
|
||||||
|
this.DelElementToolStripMenuItem});
|
||||||
|
this.ActionsToolStripMenuItem.Name =
|
||||||
|
"ActionsToolStripMenuItem";
|
||||||
|
this.ActionsToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(70, 20);
|
||||||
|
this.ActionsToolStripMenuItem.Text = "Действия";
|
||||||
|
//
|
||||||
|
// DocsToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.DocsToolStripMenuItem.DropDownItems.AddRange(new
|
||||||
|
System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.SimpleDocToolStripMenuItem,
|
||||||
|
this.TableDocToolStripMenuItem,
|
||||||
|
this.ChartDocToolStripMenuItem});
|
||||||
|
this.DocsToolStripMenuItem.Name = "DocsToolStripMenuItem";
|
||||||
|
this.DocsToolStripMenuItem.Size = new System.Drawing.Size(82, 20);
|
||||||
|
this.DocsToolStripMenuItem.Text = "Документы";
|
||||||
|
//
|
||||||
|
// SimpleDocToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.SimpleDocToolStripMenuItem.Name = "SimpleDocToolStripMenuItem";
|
||||||
|
this.SimpleDocToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.S)));
|
||||||
|
this.SimpleDocToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(233, 22);
|
||||||
|
this.SimpleDocToolStripMenuItem.Text = "Простой документ";
|
||||||
|
this.SimpleDocToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.SimpleDocToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// TableDocToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.TableDocToolStripMenuItem.Name =
|
||||||
|
"TableDocToolStripMenuItem";
|
||||||
|
this.TableDocToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.T)));
|
||||||
|
this.TableDocToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(233, 22);
|
||||||
|
this.TableDocToolStripMenuItem.Text = "Документ с таблицой";
|
||||||
|
this.TableDocToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.TableDocToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// ChartDocToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.ChartDocToolStripMenuItem.Name =
|
||||||
|
"ChartDocToolStripMenuItem";
|
||||||
|
this.ChartDocToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.C)));
|
||||||
|
this.ChartDocToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(233, 22);
|
||||||
|
this.ChartDocToolStripMenuItem.Text = "Диаграмма";
|
||||||
|
this.ChartDocToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.ChartDocToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// panelControl
|
||||||
|
//
|
||||||
|
this.panelControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.panelControl.Location = new System.Drawing.Point(0, 24);
|
||||||
|
this.panelControl.Name = "panelControl";
|
||||||
|
this.panelControl.Size = new System.Drawing.Size(800, 426);
|
||||||
|
this.panelControl.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// ThesaurusToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.ThesaurusToolStripMenuItem.Name =
|
||||||
|
"ThesaurusToolStripMenuItem";
|
||||||
|
this.ThesaurusToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.I)));
|
||||||
|
this.ThesaurusToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(180, 22);
|
||||||
|
this.ThesaurusToolStripMenuItem.Text = "Справочник";
|
||||||
|
this.ThesaurusToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.ThesaurusToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// AddElementToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.AddElementToolStripMenuItem.Name =
|
||||||
|
"AddElementToolStripMenuItem";
|
||||||
|
this.AddElementToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.A)));
|
||||||
|
this.AddElementToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(180, 22);
|
||||||
|
this.AddElementToolStripMenuItem.Text = "Добавить";
|
||||||
|
this.AddElementToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.AddElementToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// UpdElementToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.UpdElementToolStripMenuItem.Name = "UpdElementToolStripMenuItem";
|
||||||
|
this.UpdElementToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.U)));
|
||||||
|
this.UpdElementToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(180, 22);
|
||||||
|
this.UpdElementToolStripMenuItem.Text = "Изменить";
|
||||||
|
this.UpdElementToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.UpdElementToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// DelElementToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.DelElementToolStripMenuItem.Name =
|
||||||
|
"DelElementToolStripMenuItem";
|
||||||
|
this.DelElementToolStripMenuItem.ShortcutKeys =
|
||||||
|
((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control |
|
||||||
|
System.Windows.Forms.Keys.D)));
|
||||||
|
this.DelElementToolStripMenuItem.Size = new
|
||||||
|
System.Drawing.Size(180, 22);
|
||||||
|
this.DelElementToolStripMenuItem.Text = "Удалить";
|
||||||
|
this.DelElementToolStripMenuItem.Click += new
|
||||||
|
System.EventHandler(this.DelElementToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// FormMain
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.panelControl);
|
||||||
|
this.Controls.Add(this.menuStrip);
|
||||||
|
this.MainMenuStrip = this.menuStrip;
|
||||||
|
this.Name = "FormMain";
|
||||||
|
this.StartPosition =
|
||||||
|
System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Главная форма";
|
||||||
|
this.WindowState =
|
||||||
|
System.Windows.Forms.FormWindowState.Maximized;
|
||||||
|
this.KeyDown += new
|
||||||
|
System.Windows.Forms.KeyEventHandler(this.FormMain_KeyDown);
|
||||||
|
this.menuStrip.ResumeLayout(false);
|
||||||
|
this.menuStrip.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
private System.Windows.Forms.MenuStrip menuStrip;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem ControlsStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem DocsToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem SimpleDocToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem TableDocToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem ChartDocToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.Panel panelControl;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem ActionsToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem ThesaurusToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem AddElementToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem UpdElementToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem DelElementToolStripMenuItem;
|
||||||
|
}
|
||||||
|
}
|
221
LibraryByPlugins/FormMain.cs
Normal file
221
LibraryByPlugins/FormMain.cs
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
using PluginsConventionLibrary;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace LibraryByPlugins
|
||||||
|
{
|
||||||
|
public partial class FormMain : Form
|
||||||
|
{
|
||||||
|
private readonly Dictionary<string, IPluginsConvention> _plugins;
|
||||||
|
private string _selectedPlugin;
|
||||||
|
public FormMain()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_plugins = new();
|
||||||
|
LoadPlugins();
|
||||||
|
_selectedPlugin = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadPlugins()
|
||||||
|
{
|
||||||
|
List<IPluginsConvention> pluginsList = GetPlugins();
|
||||||
|
|
||||||
|
foreach (var plugin in pluginsList)
|
||||||
|
{
|
||||||
|
_plugins[plugin.PluginName] = plugin;
|
||||||
|
CreateMenuItem(plugin.PluginName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private List<IPluginsConvention> GetPlugins()
|
||||||
|
{
|
||||||
|
string currentDir = Environment.CurrentDirectory;
|
||||||
|
string pluginsDir = Directory.GetParent(currentDir).Parent.Parent.Parent.FullName + "\\Plugins";
|
||||||
|
string[] dllFiles = Directory.GetFiles(
|
||||||
|
pluginsDir,
|
||||||
|
"*.dll",
|
||||||
|
SearchOption.AllDirectories
|
||||||
|
);
|
||||||
|
List<IPluginsConvention> plugins = new();
|
||||||
|
foreach (string dllFile in dllFiles)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Assembly assembly = Assembly.LoadFrom(dllFile);
|
||||||
|
Type[] types = assembly.GetTypes();
|
||||||
|
foreach (Type type in types)
|
||||||
|
{
|
||||||
|
if (typeof(IPluginsConvention).IsAssignableFrom(type) && !type.IsInterface)
|
||||||
|
{
|
||||||
|
if (Activator.CreateInstance(type) is IPluginsConvention plugin)
|
||||||
|
{
|
||||||
|
plugins.Add(plugin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(
|
||||||
|
ex.Message
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
private void CreateMenuItem(string pluginName)
|
||||||
|
{
|
||||||
|
ToolStripMenuItem menuItem = new ToolStripMenuItem(pluginName);
|
||||||
|
menuItem.Click += (object? sender, EventArgs a) =>
|
||||||
|
{
|
||||||
|
_selectedPlugin = pluginName;
|
||||||
|
IPluginsConvention plugin = _plugins[pluginName];
|
||||||
|
UserControl userControl = plugin.GetControl;
|
||||||
|
if (userControl != null)
|
||||||
|
{
|
||||||
|
panelControl.Controls.Clear();
|
||||||
|
plugin.ReloadData();
|
||||||
|
userControl.Dock = DockStyle.Fill;
|
||||||
|
panelControl.Controls.Add(userControl);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ControlsStripMenuItem.DropDownItems.Add(menuItem);
|
||||||
|
}
|
||||||
|
private void FormMain_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_selectedPlugin) ||
|
||||||
|
!_plugins.ContainsKey(_selectedPlugin))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!e.Control)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (e.KeyCode)
|
||||||
|
{
|
||||||
|
case Keys.I:
|
||||||
|
ShowThesaurus();
|
||||||
|
break;
|
||||||
|
case Keys.A:
|
||||||
|
AddNewElement();
|
||||||
|
break;
|
||||||
|
case Keys.U:
|
||||||
|
UpdateElement();
|
||||||
|
break;
|
||||||
|
case Keys.D:
|
||||||
|
DeleteElement();
|
||||||
|
break;
|
||||||
|
case Keys.S:
|
||||||
|
CreateSimpleDoc();
|
||||||
|
break;
|
||||||
|
case Keys.T:
|
||||||
|
CreateTableDoc();
|
||||||
|
break;
|
||||||
|
case Keys.C:
|
||||||
|
CreateChartDoc();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ShowThesaurus()
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].GetThesaurus()?.Show();
|
||||||
|
}
|
||||||
|
private void AddNewElement()
|
||||||
|
{
|
||||||
|
var form = _plugins[_selectedPlugin].GetForm(null);
|
||||||
|
if (form != null && form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].ReloadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateElement()
|
||||||
|
{
|
||||||
|
var element = _plugins[_selectedPlugin].GetElement;
|
||||||
|
if (element == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не выбран элемент для обновления",
|
||||||
|
"Ошибка",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var form = _plugins[_selectedPlugin].GetForm(element);
|
||||||
|
if (form != null && form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].ReloadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void DeleteElement()
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Удалить выбранный элемент?",
|
||||||
|
"Удаление",
|
||||||
|
MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var element = _plugins[_selectedPlugin].GetElement;
|
||||||
|
if (element == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не выбран элемент для удаления",
|
||||||
|
"Ошибка",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_plugins[_selectedPlugin].DeleteElement(element))
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].ReloadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void CreateSimpleDoc()
|
||||||
|
{
|
||||||
|
SaveFileDialog saveFileDialog = new()
|
||||||
|
{
|
||||||
|
Filter = "PDF Files|*.pdf"
|
||||||
|
};
|
||||||
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].CreateSimpleDocument(new PluginsConventionSaveDocument() { FileName = saveFileDialog.FileName });
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void CreateTableDoc()
|
||||||
|
{
|
||||||
|
SaveFileDialog saveFileDialog = new()
|
||||||
|
{
|
||||||
|
Filter = "Excel Files|*.xlsx"
|
||||||
|
};
|
||||||
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].CreateTableDocument(new PluginsConventionSaveDocument() { FileName = saveFileDialog.FileName });
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void CreateChartDoc()
|
||||||
|
{
|
||||||
|
SaveFileDialog saveFileDialog = new()
|
||||||
|
{
|
||||||
|
Filter = "Word Files|*.docx"
|
||||||
|
};
|
||||||
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_plugins[_selectedPlugin].CreateChartDocument(new PluginsConventionSaveDocument() { FileName = saveFileDialog.FileName });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ThesaurusToolStripMenuItem_Click(object sender,
|
||||||
|
EventArgs e) => ShowThesaurus();
|
||||||
|
private void AddElementToolStripMenuItem_Click(object sender,
|
||||||
|
EventArgs e) => AddNewElement();
|
||||||
|
private void UpdElementToolStripMenuItem_Click(object sender,
|
||||||
|
EventArgs e) => UpdateElement();
|
||||||
|
private void DelElementToolStripMenuItem_Click(object sender,
|
||||||
|
EventArgs e) => DeleteElement();
|
||||||
|
private void SimpleDocToolStripMenuItem_Click(object sender,
|
||||||
|
EventArgs e) => CreateSimpleDoc();
|
||||||
|
private void TableDocToolStripMenuItem_Click(object sender, EventArgs
|
||||||
|
e) => CreateTableDoc();
|
||||||
|
private void ChartDocToolStripMenuItem_Click(object sender, EventArgs
|
||||||
|
e) => CreateChartDoc();
|
||||||
|
private void FormMain_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
123
LibraryByPlugins/FormMain.resx
Normal file
123
LibraryByPlugins/FormMain.resx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
22
LibraryByPlugins/LibraryByPlugins.csproj
Normal file
22
LibraryByPlugins/LibraryByPlugins.csproj
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
|
||||||
|
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
|
||||||
|
<PackageReference Include="System.Text.Json" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
|
||||||
|
<ProjectReference Include="..\PluginsConventionLibrary\PluginsConventionLibrary.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
17
LibraryByPlugins/Program.cs
Normal file
17
LibraryByPlugins/Program.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace LibraryByPlugins
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
|
// see https://aka.ms/applicationconfiguration.
|
||||||
|
ApplicationConfiguration.Initialize();
|
||||||
|
Application.Run(new FormMain());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
Plugins/Aspose.Words.Pdf2Word.dll
Normal file
BIN
Plugins/Aspose.Words.Pdf2Word.dll
Normal file
Binary file not shown.
BIN
Plugins/Aspose.Words.dll
Normal file
BIN
Plugins/Aspose.Words.dll
Normal file
Binary file not shown.
BIN
Plugins/Azure.Core.dll
Normal file
BIN
Plugins/Azure.Core.dll
Normal file
Binary file not shown.
BIN
Plugins/Azure.Identity.dll
Normal file
BIN
Plugins/Azure.Identity.dll
Normal file
Binary file not shown.
BIN
Plugins/BusinessLogic.dll
Normal file
BIN
Plugins/BusinessLogic.dll
Normal file
Binary file not shown.
BIN
Plugins/ComponentsLibraryNet60.dll
Normal file
BIN
Plugins/ComponentsLibraryNet60.dll
Normal file
Binary file not shown.
BIN
Plugins/Contracts.dll
Normal file
BIN
Plugins/Contracts.dll
Normal file
Binary file not shown.
BIN
Plugins/CustomComponents.dll
Normal file
BIN
Plugins/CustomComponents.dll
Normal file
Binary file not shown.
BIN
Plugins/DatabaseImplement.dll
Normal file
BIN
Plugins/DatabaseImplement.dll
Normal file
Binary file not shown.
BIN
Plugins/DocumentFormat.OpenXml.dll
Normal file
BIN
Plugins/DocumentFormat.OpenXml.dll
Normal file
Binary file not shown.
BIN
Plugins/Humanizer.dll
Normal file
BIN
Plugins/Humanizer.dll
Normal file
Binary file not shown.
BIN
Plugins/KOP_Labs.dll
Normal file
BIN
Plugins/KOP_Labs.dll
Normal file
Binary file not shown.
BIN
Plugins/Library.dll
Normal file
BIN
Plugins/Library.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
BIN
Plugins/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Data.SqlClient.dll
Normal file
BIN
Plugins/Microsoft.Data.SqlClient.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.EntityFrameworkCore.Abstractions.dll
Normal file
BIN
Plugins/Microsoft.EntityFrameworkCore.Abstractions.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.EntityFrameworkCore.Design.dll
Normal file
BIN
Plugins/Microsoft.EntityFrameworkCore.Design.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.EntityFrameworkCore.Relational.dll
Normal file
BIN
Plugins/Microsoft.EntityFrameworkCore.Relational.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.EntityFrameworkCore.SqlServer.dll
Normal file
BIN
Plugins/Microsoft.EntityFrameworkCore.SqlServer.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.EntityFrameworkCore.dll
Normal file
BIN
Plugins/Microsoft.EntityFrameworkCore.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Caching.Abstractions.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Caching.Abstractions.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Caching.Memory.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Caching.Memory.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Configuration.Abstractions.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Configuration.Abstractions.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.DependencyInjection.dll
Normal file
BIN
Plugins/Microsoft.Extensions.DependencyInjection.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.DependencyModel.dll
Normal file
BIN
Plugins/Microsoft.Extensions.DependencyModel.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Logging.Abstractions.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Logging.Abstractions.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Logging.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Logging.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Options.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Options.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Extensions.Primitives.dll
Normal file
BIN
Plugins/Microsoft.Extensions.Primitives.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Identity.Client.Extensions.Msal.dll
Normal file
BIN
Plugins/Microsoft.Identity.Client.Extensions.Msal.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Identity.Client.dll
Normal file
BIN
Plugins/Microsoft.Identity.Client.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.IdentityModel.Abstractions.dll
Normal file
BIN
Plugins/Microsoft.IdentityModel.Abstractions.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.IdentityModel.JsonWebTokens.dll
Normal file
BIN
Plugins/Microsoft.IdentityModel.JsonWebTokens.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.IdentityModel.Logging.dll
Normal file
BIN
Plugins/Microsoft.IdentityModel.Logging.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
Normal file
BIN
Plugins/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.IdentityModel.Protocols.dll
Normal file
BIN
Plugins/Microsoft.IdentityModel.Protocols.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.IdentityModel.Tokens.dll
Normal file
BIN
Plugins/Microsoft.IdentityModel.Tokens.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Office.Interop.Excel.dll
Normal file
BIN
Plugins/Microsoft.Office.Interop.Excel.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.SqlServer.Server.dll
Normal file
BIN
Plugins/Microsoft.SqlServer.Server.dll
Normal file
Binary file not shown.
BIN
Plugins/Microsoft.Vbe.Interop.dll
Normal file
BIN
Plugins/Microsoft.Vbe.Interop.dll
Normal file
Binary file not shown.
BIN
Plugins/MigraDoc.DocumentObjectModel.dll
Normal file
BIN
Plugins/MigraDoc.DocumentObjectModel.dll
Normal file
Binary file not shown.
BIN
Plugins/MigraDoc.Rendering.dll
Normal file
BIN
Plugins/MigraDoc.Rendering.dll
Normal file
Binary file not shown.
BIN
Plugins/MigraDoc.RtfRendering.dll
Normal file
BIN
Plugins/MigraDoc.RtfRendering.dll
Normal file
Binary file not shown.
BIN
Plugins/Mono.TextTemplating.dll
Normal file
BIN
Plugins/Mono.TextTemplating.dll
Normal file
Binary file not shown.
BIN
Plugins/Office.dll
Normal file
BIN
Plugins/Office.dll
Normal file
Binary file not shown.
BIN
Plugins/PdfSharp.Charting.dll
Normal file
BIN
Plugins/PdfSharp.Charting.dll
Normal file
Binary file not shown.
BIN
Plugins/PdfSharp.dll
Normal file
BIN
Plugins/PdfSharp.dll
Normal file
Binary file not shown.
BIN
Plugins/PluginsConventionLibrary.dll
Normal file
BIN
Plugins/PluginsConventionLibrary.dll
Normal file
Binary file not shown.
BIN
Plugins/SkiaSharp.dll
Normal file
BIN
Plugins/SkiaSharp.dll
Normal file
Binary file not shown.
BIN
Plugins/System.IdentityModel.Tokens.Jwt.dll
Normal file
BIN
Plugins/System.IdentityModel.Tokens.Jwt.dll
Normal file
Binary file not shown.
BIN
Plugins/System.Memory.Data.dll
Normal file
BIN
Plugins/System.Memory.Data.dll
Normal file
Binary file not shown.
BIN
Plugins/System.Runtime.Caching.dll
Normal file
BIN
Plugins/System.Runtime.Caching.dll
Normal file
Binary file not shown.
BIN
Plugins/System.Text.Encoding.CodePages.dll
Normal file
BIN
Plugins/System.Text.Encoding.CodePages.dll
Normal file
Binary file not shown.
BIN
Plugins/System.Text.Encodings.Web.dll
Normal file
BIN
Plugins/System.Text.Encodings.Web.dll
Normal file
Binary file not shown.
BIN
Plugins/System.Text.Json.dll
Normal file
BIN
Plugins/System.Text.Json.dll
Normal file
Binary file not shown.
BIN
Plugins/Unity.Abstractions.dll
Normal file
BIN
Plugins/Unity.Abstractions.dll
Normal file
Binary file not shown.
BIN
Plugins/Unity.Container.dll
Normal file
BIN
Plugins/Unity.Container.dll
Normal file
Binary file not shown.
BIN
Plugins/ViewComponents.dll
Normal file
BIN
Plugins/ViewComponents.dll
Normal file
Binary file not shown.
64
PluginsConventionLibrary/IPluginsConvention.cs
Normal file
64
PluginsConventionLibrary/IPluginsConvention.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
13
PluginsConventionLibrary/PluginsConventionElement.cs
Normal file
13
PluginsConventionLibrary/PluginsConventionElement.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
10
PluginsConventionLibrary/PluginsConventionLibrary.csproj
Normal file
10
PluginsConventionLibrary/PluginsConventionLibrary.csproj
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
13
PluginsConventionLibrary/PluginsConventionSaveDocument.cs
Normal file
13
PluginsConventionLibrary/PluginsConventionSaveDocument.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
BIN
TestView/Plugins/Aspose.Words.Pdf2Word.dll
Normal file
BIN
TestView/Plugins/Aspose.Words.Pdf2Word.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Aspose.Words.dll
Normal file
BIN
TestView/Plugins/Aspose.Words.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Azure.Core.dll
Normal file
BIN
TestView/Plugins/Azure.Core.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Azure.Identity.dll
Normal file
BIN
TestView/Plugins/Azure.Identity.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/BusinessLogic.dll
Normal file
BIN
TestView/Plugins/BusinessLogic.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/ComponentsLibraryNet60.dll
Normal file
BIN
TestView/Plugins/ComponentsLibraryNet60.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Contracts.dll
Normal file
BIN
TestView/Plugins/Contracts.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/CustomComponents.dll
Normal file
BIN
TestView/Plugins/CustomComponents.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/DatabaseImplement.dll
Normal file
BIN
TestView/Plugins/DatabaseImplement.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/DocumentFormat.OpenXml.dll
Normal file
BIN
TestView/Plugins/DocumentFormat.OpenXml.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Humanizer.dll
Normal file
BIN
TestView/Plugins/Humanizer.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/KOP_Labs.dll
Normal file
BIN
TestView/Plugins/KOP_Labs.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Library.dll
Normal file
BIN
TestView/Plugins/Library.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
BIN
TestView/Plugins/Microsoft.Bcl.AsyncInterfaces.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Data.SqlClient.dll
Normal file
BIN
TestView/Plugins/Microsoft.Data.SqlClient.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.Abstractions.dll
Normal file
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.Abstractions.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.Design.dll
Normal file
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.Design.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.Relational.dll
Normal file
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.Relational.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.SqlServer.dll
Normal file
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.SqlServer.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.dll
Normal file
BIN
TestView/Plugins/Microsoft.EntityFrameworkCore.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.Caching.Abstractions.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.Caching.Abstractions.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.Caching.Memory.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.Caching.Memory.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.DependencyInjection.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.DependencyInjection.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.DependencyModel.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.DependencyModel.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.Logging.Abstractions.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.Logging.Abstractions.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.Logging.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.Logging.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.Options.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.Options.dll
Normal file
Binary file not shown.
BIN
TestView/Plugins/Microsoft.Extensions.Primitives.dll
Normal file
BIN
TestView/Plugins/Microsoft.Extensions.Primitives.dll
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user