Creating Custom Context Menu
The IT Hit User File System supports creating custom context menus on both Windows and macOS. In this article we describe steps that are common for both platforms. Each platform requires additional steps for registering the menu described in these articles:
- Creating Custom Windows Explorer Context Menu Shell Extension
- Creating Custom macOS Finder Context Menu
The functionality described in this article is available in IT Hit User File System v5 Beta and later versions.
Follow the steps below to add custom context menu command shell extension in Windows Explorer:
1. Implement Context Menu Interface
Depending on the platform, implement the menu interface: IMenuCommandWindows on Windows or IMenuCommand on macOS.
2. Return Context Menu Implementation from the Engine
To add a custom menu implement the IEngine.GetMenuCommandAsync() method and return your menu implementation. The Engine will call this method passing the menu GUID parameter, so you can implement multiple menu commands on the first level of the menu:
public class VirtualEngine : EngineWindows { ... public override async Task<IMenuCommand> GetMenuCommandAsync(Guid menuGuid) { // Return your menu implementation here depending on the menu GUID. } }