Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task] Add menu button and show message #1546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/EasyEPlanner.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -121,6 +121,7 @@
<Compile Include="Main\ImportIcpCreateRenamingMap.cs" />
<Compile Include="Main\ImportIcpWagoProject.cs" />
<Compile Include="Main\ModifyIcpChbase.cs" />
<Compile Include="Main\ShowMessageBox.cs" />
<Compile Include="ProjectImportICP\BindingImporter.cs" />
<Compile Include="ProjectImportICP\DeviceNameMatchingSaver.cs" />
<Compile Include="ProjectImportICP\DevicesImporter.cs" />
Expand Down
4 changes: 4 additions & 0 deletions src/Main/AddInModule.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using EasyEPlanner.Main;
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Starter;
using System;
Expand Down Expand Up @@ -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;
Expand Down
28 changes: 28 additions & 0 deletions src/Main/ShowMessageBox.cs
Original file line number Diff line number Diff line change
@@ -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)
{
}
}
}
Loading