You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/csharp/extensibility-api-howtos/create-menu-extension.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,9 +69,11 @@ public class MyMenuExtension(IMessageBoxService messageBoxService) : MenuExtensi
69
69
70
70
Build your extension and press <kbd>F4</kbd> in Studio Pro. Menu items are placed under a corresponding menu with the extensions name. For example, if your extension is named *My Extension*, your menu items will be located under the **Extensions** > **My Company** sub-menu.
71
71
72
-
The Extensibility API provides you with several services you can use and they are injected into your extension classes by using the `ImportingConstructor` attribute.
72
+
The Extensibility API provides several services you can use and are injected into your extension classes by using the `ImportingConstructor` attribute.
73
73
74
-
It is also possible to get notified when your extension has been successfully loaded into Studio Pro and also just before it gets unloaded. It is as simple as subscribing to the `ExtensionLoaded` and `ExtensionUnloading` events.
74
+
## Subscribing to Extension Events
75
+
76
+
You can be notified when your extension has been successfully loaded and unloaded from Studio Pro by subscribing to the `ExtensionLoaded` and `ExtensionUnloading` events.
75
77
76
78
```csharp
77
79
usingMendix.StudioPro.ExtensionsAPI.UI.Events;
@@ -92,23 +94,24 @@ public class MyMenuExtension() : MenuExtension
92
94
93
95
## Debugging Your Extension
94
96
95
-
1.Make sure that the current version of the extension code is loaded in Studio Pro.
96
-
2. Attach to Studio Pro process in Visual Studio debugger as follows:
97
-
1.On the**Debug**menu, open the **Attach to Process** dialog box (or press <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>P</kbd>).
98
-
2. Search for `studiopro.exe` among the processes.
99
-
3.Select the only found process (or the one with correct title, if you have many) and select**Attach**.
97
+
1.Ensure the latest version of the extension code is loaded in Studio Pro.
98
+
2. Attach the Visual Studio debugger to Studio Pro:
3. Add a Breakpoint inside `Action` delegate in `MyMenuExtension.GetMenus()`. It will be hit when you click **Extensions** > **MyCompany** > **Say hello** menu item.
103
+
3. Add a breakpoint inside the `Action` delegate in `MyMenuExtension.GetMenus()`.
104
+
4. Trigger the breakpoint by clicking **Extensions** > **MyCompany** > **Say hello** menu item.
102
105
103
106
## Adding a NuGet Dependency
104
107
105
-
You can freely use [NuGet packages](https://www.nuget.org/)from extensions to access reusable .NET libraries. The following one-time additional setup is required:
108
+
You can access reusable .NET libraries via [NuGet](https://www.nuget.org/)Follow the steps below for a one-time setup:
106
109
107
-
1.Open your extension project `.csproj` file by right-clicking **Solution Explorer** > **Edit Project File**.
108
-
2. Add the following line into the first `<PropertyGroup>`:
110
+
1.In Visual Studio, open your extension project `.csproj` file by right-clicking **Solution Explorer** > **Edit Project File**.
111
+
2. Add the following line inside the first `<PropertyGroup>`:
0 commit comments