C# Class MediaPortal.InputDevices.HidUsageAction

Define the MP actions for various HID usages from a usage page and collection. Expects an XML file with mappings on construction. Maps button code numbers to conditions and actions.
Mostra file Open project: MediaPortal/MediaPortal-1 Class Usage Examples

Public Methods

Method Description
AttributeValueToBoolean ( XmlAttribute aAttribute, bool aDefault = false ) : bool

Convert an XML attribute value to boolean

AttributeValueToBoolean ( string aValue, bool aDefault = false ) : bool

ExecuteActionIfNeeded ( ConditionalAction aAction, int aProcessId = -1 ) : bool

Execute the given conditional action if needed.

GetAction ( string aButtonCode, bool aIsBackground, bool aIsRepeat, bool aShift, bool aCtrl, bool aAlt, bool aWin ) : ConditionalAction

/// Get mappings for a given button code based on the current conditions.

HidUsageAction ( ) : System
Load ( XmlNode aXmlNode, TryParseUsage aTryParseUsage ) : void

Load mapping from XML file

Method Details

AttributeValueToBoolean() public static method

Convert an XML attribute value to boolean
public static AttributeValueToBoolean ( XmlAttribute aAttribute, bool aDefault = false ) : bool
aAttribute System.Xml.XmlAttribute
aDefault bool
return bool

AttributeValueToBoolean() public static method

public static AttributeValueToBoolean ( string aValue, bool aDefault = false ) : bool
aValue string
aDefault bool
return bool

ExecuteActionIfNeeded() public method

Execute the given conditional action if needed.
public ExecuteActionIfNeeded ( ConditionalAction aAction, int aProcessId = -1 ) : bool
aAction ConditionalAction The action we want to conditionally execute.
aProcessId int Process-ID for close/kill commands.
return bool

GetAction() public method

/// Get mappings for a given button code based on the current conditions.
public GetAction ( string aButtonCode, bool aIsBackground, bool aIsRepeat, bool aShift, bool aCtrl, bool aAlt, bool aWin ) : ConditionalAction
aButtonCode string
aIsBackground bool
aIsRepeat bool
aShift bool
aCtrl bool
aAlt bool
aWin bool
return ConditionalAction

HidUsageAction() public method

public HidUsageAction ( ) : System
return System

Load() public method

Load mapping from XML file
public Load ( XmlNode aXmlNode, TryParseUsage aTryParseUsage ) : void
aXmlNode System.Xml.XmlNode
aTryParseUsage TryParseUsage
return void