From 1b9fc512099223c234fdf242fc5c251e43147e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B7=D0=B8=D0=B1=D1=83=D0=BA=20=D0=90=D0=BB=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Sat, 15 Feb 2025 00:47:47 +0300 Subject: [PATCH] Add menu buttom and show message --- src/EasyEPlanner.csproj | 3 ++- src/Main/AddInModule.cs | 4 ++++ src/Main/ShowMessageBox.cs | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/Main/ShowMessageBox.cs diff --git a/src/EasyEPlanner.csproj b/src/EasyEPlanner.csproj index b085180a..2bca6bbf 100644 --- a/src/EasyEPlanner.csproj +++ b/src/EasyEPlanner.csproj @@ -1,4 +1,4 @@ - + Debug @@ -121,6 +121,7 @@ + diff --git a/src/Main/AddInModule.cs b/src/Main/AddInModule.cs index 3871ff82..91e0aa60 100644 --- a/src/Main/AddInModule.cs +++ b/src/Main/AddInModule.cs @@ -1,3 +1,4 @@ +using EasyEPlanner.Main; using Eplan.EplApi.ApplicationFramework; using Eplan.EplApi.Starter; using System; @@ -95,6 +96,9 @@ public bool OnInitGui() menuID = oMenu.AddMenuItem("О дополнении", "AboutProgramm", "", menuID, 1, false, false); + menuID = oMenu.AddMenuItem("Новая кнопка", nameof(ShowMessageBox), "", + menuID, 1, false, false); + ProjectManager.GetInstance().Init(); return true; diff --git a/src/Main/ShowMessageBox.cs b/src/Main/ShowMessageBox.cs new file mode 100644 index 00000000..d539b28a --- /dev/null +++ b/src/Main/ShowMessageBox.cs @@ -0,0 +1,28 @@ +using Eplan.EplApi.ApplicationFramework; +using System.Windows.Forms; + +namespace EasyEPlanner.Main +{ + class ShowMessageBox : IEplAction + { + ~ShowMessageBox() { } + + public bool Execute(ActionCallingContext oActionCallingContext) + { + MessageBox.Show("Кнопка меню нажата", "MB"); + return true; + } + + + public bool OnRegister(ref string Name, ref int Ordinal) + { + Name = nameof(ShowMessageBox); + + return true; + } + + public void GetActionProperties(ref ActionProperties actionProperties) + { + } + } +} \ No newline at end of file