From 0bc52d4d10078b3f508e339997f6f9fa8529a45f Mon Sep 17 00:00:00 2001 From: maxnes3 <112558334+maxnes3@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:08:41 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=20=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B0=D1=82=D1=8C=20=D0=BB=D0=B0=D0=B1=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + .../IPluginsConvention.cs | 22 ++++ .../PluginsConventionElement.cs | 13 ++ .../PluginsConventionLibrary.csproj | 10 ++ .../PluginsConventionSaveDocument.cs | 13 ++ WinForm/WinForm.sln | 14 +- .../WinFormsAppByPlugins/Form1.Designer.cs | 39 ++++++ WinForm/WinFormsAppByPlugins/Form1.cs | 10 ++ WinForm/WinFormsAppByPlugins/Form1.resx | 120 ++++++++++++++++++ WinForm/WinFormsAppByPlugins/Program.cs | 17 +++ .../WinFormsAppByPlugins.csproj | 11 ++ 11 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 WinForm/PluginsConventionLibrary/IPluginsConvention.cs create mode 100644 WinForm/PluginsConventionLibrary/PluginsConventionElement.cs create mode 100644 WinForm/PluginsConventionLibrary/PluginsConventionLibrary.csproj create mode 100644 WinForm/PluginsConventionLibrary/PluginsConventionSaveDocument.cs create mode 100644 WinForm/WinFormsAppByPlugins/Form1.Designer.cs create mode 100644 WinForm/WinFormsAppByPlugins/Form1.cs create mode 100644 WinForm/WinFormsAppByPlugins/Form1.resx create mode 100644 WinForm/WinFormsAppByPlugins/Program.cs create mode 100644 WinForm/WinFormsAppByPlugins/WinFormsAppByPlugins.csproj diff --git a/.gitignore b/.gitignore index ca1c7a3..99b8a56 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ ## ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +*.dll + # User-specific files *.rsuser *.suo diff --git a/WinForm/PluginsConventionLibrary/IPluginsConvention.cs b/WinForm/PluginsConventionLibrary/IPluginsConvention.cs new file mode 100644 index 0000000..47a3c37 --- /dev/null +++ b/WinForm/PluginsConventionLibrary/IPluginsConvention.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PluginsConventionLibrary +{ + public interface IPluginsConvention + { + string PluginName { get; } + UserControl GetControl { get; } + PluginsConventionElement GetElement { get; } + Form GetForm(PluginsConventionElement element); + Form GetThesaurus(); + bool DeleteElement(PluginsConventionElement element); + void ReloadData(); + bool CreateSimpleDocument(PluginsConventionSaveDocument saveDocument); + bool CreateTableDocument(PluginsConventionSaveDocument saveDocument); + bool CreateChartDocument(PluginsConventionSaveDocument saveDocument); + } +} diff --git a/WinForm/PluginsConventionLibrary/PluginsConventionElement.cs b/WinForm/PluginsConventionLibrary/PluginsConventionElement.cs new file mode 100644 index 0000000..775c74a --- /dev/null +++ b/WinForm/PluginsConventionLibrary/PluginsConventionElement.cs @@ -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; } + } +} diff --git a/WinForm/PluginsConventionLibrary/PluginsConventionLibrary.csproj b/WinForm/PluginsConventionLibrary/PluginsConventionLibrary.csproj new file mode 100644 index 0000000..060aa1c --- /dev/null +++ b/WinForm/PluginsConventionLibrary/PluginsConventionLibrary.csproj @@ -0,0 +1,10 @@ + + + + net6.0-windows + enable + true + enable + + + diff --git a/WinForm/PluginsConventionLibrary/PluginsConventionSaveDocument.cs b/WinForm/PluginsConventionLibrary/PluginsConventionSaveDocument.cs new file mode 100644 index 0000000..f902bc6 --- /dev/null +++ b/WinForm/PluginsConventionLibrary/PluginsConventionSaveDocument.cs @@ -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; } + } +} diff --git a/WinForm/WinForm.sln b/WinForm/WinForm.sln index b8d5675..3281f04 100644 --- a/WinForm/WinForm.sln +++ b/WinForm/WinForm.sln @@ -13,7 +13,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataBaseImplement", "DataBa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppView", "AppView\AppView.csproj", "{9BD73EC6-6B32-4CBB-8D04-9D4650562846}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfFormsLibrary", "PdfFormsLibrary\PdfFormsLibrary.csproj", "{2BFDA66F-E786-4C74-8D3A-054C6D1FDF7D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfFormsLibrary", "PdfFormsLibrary\PdfFormsLibrary.csproj", "{2BFDA66F-E786-4C74-8D3A-054C6D1FDF7D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsAppByPlugins", "WinFormsAppByPlugins\WinFormsAppByPlugins.csproj", "{77CB7F0C-2666-40BC-96A6-CC210D2F008B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginsConventionLibrary", "PluginsConventionLibrary\PluginsConventionLibrary.csproj", "{98754D56-A3B4-4A0E-A7F2-74FFE8AE67BA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -45,6 +49,14 @@ Global {2BFDA66F-E786-4C74-8D3A-054C6D1FDF7D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2BFDA66F-E786-4C74-8D3A-054C6D1FDF7D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2BFDA66F-E786-4C74-8D3A-054C6D1FDF7D}.Release|Any CPU.Build.0 = Release|Any CPU + {77CB7F0C-2666-40BC-96A6-CC210D2F008B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77CB7F0C-2666-40BC-96A6-CC210D2F008B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77CB7F0C-2666-40BC-96A6-CC210D2F008B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77CB7F0C-2666-40BC-96A6-CC210D2F008B}.Release|Any CPU.Build.0 = Release|Any CPU + {98754D56-A3B4-4A0E-A7F2-74FFE8AE67BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98754D56-A3B4-4A0E-A7F2-74FFE8AE67BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98754D56-A3B4-4A0E-A7F2-74FFE8AE67BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98754D56-A3B4-4A0E-A7F2-74FFE8AE67BA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/WinForm/WinFormsAppByPlugins/Form1.Designer.cs b/WinForm/WinFormsAppByPlugins/Form1.Designer.cs new file mode 100644 index 0000000..b730c78 --- /dev/null +++ b/WinForm/WinFormsAppByPlugins/Form1.Designer.cs @@ -0,0 +1,39 @@ +namespace WinFormsAppByPlugins +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} \ No newline at end of file diff --git a/WinForm/WinFormsAppByPlugins/Form1.cs b/WinForm/WinFormsAppByPlugins/Form1.cs new file mode 100644 index 0000000..df452a8 --- /dev/null +++ b/WinForm/WinFormsAppByPlugins/Form1.cs @@ -0,0 +1,10 @@ +namespace WinFormsAppByPlugins +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/WinForm/WinFormsAppByPlugins/Form1.resx b/WinForm/WinFormsAppByPlugins/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WinForm/WinFormsAppByPlugins/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinForm/WinFormsAppByPlugins/Program.cs b/WinForm/WinFormsAppByPlugins/Program.cs new file mode 100644 index 0000000..2974b5f --- /dev/null +++ b/WinForm/WinFormsAppByPlugins/Program.cs @@ -0,0 +1,17 @@ +namespace WinFormsAppByPlugins +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [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 Form1()); + } + } +} \ No newline at end of file diff --git a/WinForm/WinFormsAppByPlugins/WinFormsAppByPlugins.csproj b/WinForm/WinFormsAppByPlugins/WinFormsAppByPlugins.csproj new file mode 100644 index 0000000..b57c89e --- /dev/null +++ b/WinForm/WinFormsAppByPlugins/WinFormsAppByPlugins.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + \ No newline at end of file