LocalizableCommandInMenuAttribute

Namespace: Digi21.DigiNG.Plugin.Menu
Assembly: Digi21.DigiNG.Plugin

Like CommandInMenuAttribute, with the menu item text read from the extension's resources.

[AttributeUsage(AttributeTargets.Class)]
public class LocalizableCommandInMenuAttribute : CommandInMenuAttribute

Inherits from: CommandInMenuAttribute.

Constructors

public LocalizableCommandInMenuAttribute(Type resourceManagerProvider, string titleResource, MenuItemGroup group)
Parameter Description
resourceManagerProvider Type with a non-public static property of type ResourceManager. The requirements are those of LocalizableCommandAttribute.
titleResource Resource key containing the item text. The resource string is assigned to Title.
group Menu position. Assigned to Group.

The constructor throws ArgumentException if resourceManagerProvider has no non-public static property of type ResourceManager or the resource does not contain the titleResource key.

Digi3D.AI creates the attribute whenever the user opens the submenu at position group, rather than when loading the extension. If the constructor throws ArgumentException at that time, Digi3D.AI does not add that command's item to the menu and writes the exception message through System.Diagnostics.Trace.

Example

The LocalizableCommandAttribute example adds the CUENTA_LINEAS command to Tools, after Configuration..., with the text from the CuentaLineasMenu resource.