Skip to main content

PluginDynamicAction Class

Base class for dynamic actions.

public abstract class PluginDynamicAction : Loupedeck.PluginAction

Inheritance System.Object → Loupedeck.PluginActionBase<Loupedeck.PluginAction> → Loupedeck.PluginAction → PluginDynamicAction

Derived
↳ PluginDynamicAdjustment
↳ PluginDynamicCommand

Remarks​

This class provides the foundation for dynamic commands and adjustments. Inherit from PluginDynamicCommand or PluginDynamicAdjustment instead of using this class directly.

Properties​

PluginDynamicAction.IsEnabled Property​

Gets or sets a value indicating whether this action is enabled.

public bool IsEnabled { get; protected set; }

Property Value​

System.Boolean

Remarks​

When set to false, the action will not execute and will appear disabled in the user interface.

Methods​

PluginDynamicAction.ActionImageChanged() Method​

Notifies the Logi Plugin Service that the action's display name or image has changed.

protected void ActionImageChanged();

Remarks​

Call this method after the action's visual appearance changes to update the display on the device and in the user interface.

PluginDynamicAction.ActionImageChanged(string) Method​

Notifies the Logi Plugin Service that the action's display name or image has changed.

protected void ActionImageChanged(string actionParameter);

Parameters​

actionParameter System.String

The parameter name identifying which variation of the action has changed, or null if this action has no parameters.

Remarks​

Call this method after the action's visual appearance changes to update the display on the device and in the user interface.

PluginDynamicAction.AddParameter(string, string, string) Method​

Registers a parameter to create action variations with different behaviors.

protected Loupedeck.PluginActionParameter AddParameter(string name, string displayName, string groupName);

Parameters​

name System.String

The unique name identifier for this parameter.

displayName System.String

The display name shown for this parameter in the user interface.

groupName System.String

The group name used to organize this parameter in the user interface.

Returns​

Loupedeck.PluginActionParameter
The created parameter object.

Remarks​

Use parameters to create variations of an action with different behaviors. For example, a volume control command might have parameters for "Master", "Music", and "Voice" channels. After adding parameters, call ParametersChanged() to notify the Logi Plugin Service.

PluginDynamicAction.AdjustmentValueChanged() Method​

Notifies the Logi Plugin Service that the adjustment value has changed.

protected void AdjustmentValueChanged();

Remarks​

Call this method from PluginDynamicAdjustment implementations when the adjustment's value changes to update the display on the device and in the user interface.

PluginDynamicAction.AdjustmentValueChanged(PluginAdjustmentValue) Method​

Notifies the Logi Plugin Service that the adjustment value has changed.

protected void AdjustmentValueChanged(Loupedeck.PluginAdjustmentValue adjustmentValue);

Parameters​

adjustmentValue Loupedeck.PluginAdjustmentValue

The new adjustment value.

Remarks​

Call this method from PluginDynamicAdjustment implementations when the adjustment's value changes to update the display on the device and in the user interface.

PluginDynamicAction.AdjustmentValueChanged(string) Method​

Notifies the Logi Plugin Service that the adjustment value has changed.

protected void AdjustmentValueChanged(string actionParameter);

Parameters​

actionParameter System.String

The parameter name identifying which variation of the adjustment has changed, or null if this action has no parameters.

Remarks​

Call this method from PluginDynamicAdjustment implementations when the adjustment's value changes to update the display on the device and in the user interface.

PluginDynamicAction.AdjustmentValueChanged(string, PluginAdjustmentValue) Method​

Notifies the Logi Plugin Service that the adjustment value has changed.

protected void AdjustmentValueChanged(string actionParameter, Loupedeck.PluginAdjustmentValue adjustmentValue);

Parameters​

actionParameter System.String

The parameter name identifying which variation of the adjustment has changed, or null if this action has no parameters.

adjustmentValue Loupedeck.PluginAdjustmentValue

The new adjustment value.

Remarks​

Call this method from PluginDynamicAdjustment implementations when the adjustment's value changes to update the display on the device and in the user interface.

PluginDynamicAction.GetCommandDisplayName(string, PluginImageSize) Method​

Gets the display name for this command.

protected virtual string GetCommandDisplayName(string actionParameter, Loupedeck.PluginImageSize imageSize);

Parameters​

actionParameter System.String

The parameter name identifying which variation of the action to display, or null if this action has no parameters.

imageSize PluginImageSize

The size of the image being rendered, which may affect the display name.

Returns​

System.String
The display name to show for this command, or null to use the default display name.

Remarks​

Override this method to provide dynamic display names that change based on the action's state. This method is called when the Logi Plugin Service needs to display the command on the device or in the user interface.

PluginDynamicAction.GetCommandImage(string, PluginImageSize) Method​

Gets the action icon image for this command.

protected virtual Loupedeck.BitmapImage GetCommandImage(string actionParameter, Loupedeck.PluginImageSize imageSize);

Parameters​

actionParameter System.String

The parameter name identifying which variation of the action to display, or null if this action has no parameters.

imageSize PluginImageSize

The size of the image to generate.

Returns​

Loupedeck.BitmapImage
A Loupedeck.BitmapImage representing the command's icon, or null if no custom image is provided.

Remarks​

Override this method to provide dynamic images that change based on the action's state. This method is called when the Logi Plugin Service needs to display the command on the device or in the user interface. Use Loupedeck.EmbeddedResources to load images from the plugin assembly, or generate images dynamically using Loupedeck.BitmapImage methods.

PluginDynamicAction.OnLoad() Method​

Called after the parent plugin is loaded.

protected virtual bool OnLoad();

Returns​

System.Boolean
true if the action loaded successfully; otherwise, false.

Remarks​

Override this method to perform action-specific initialization such as subscribing to events or setting initial state.

PluginDynamicAction.OnUnload() Method​

Called before the parent plugin is unloaded.

protected virtual bool OnUnload();

Returns​

System.Boolean
true if the action unloaded successfully; otherwise, false.

Remarks​

Override this method to perform cleanup such as unsubscribing from events or releasing resources.

PluginDynamicAction.ParametersChanged() Method​

Notifies the Logi Plugin Service that the action's parameters have changed.

protected void ParametersChanged();

Remarks​

Call this method after adding, removing, or modifying parameters to update the user interface with the new parameter list.

PluginDynamicAction.RunCommand(string) Method​

Called when the user executes this command.

protected virtual void RunCommand(string actionParameter);

Parameters​

actionParameter System.String

The parameter name identifying which variation of the action to execute, or null if this action has no parameters.

Example​

protected override void RunCommand(String actionParameter)
{
// Toggle mute state
this._isMuted = !this._isMuted;

// Send command to target application
this.Plugin.ClientApplication.SendKeyPress(Enums.VirtualKeyCode.VolumeMute);

// Update the action icon to reflect new state
this.ActionImageChanged();
}

Remarks​

Override this method to implement the command's behavior. This method is called when the user presses a button mapped to this command on the device or in the host application.