/// <summary> /// Send a WinLirc command /// </summary> /// <param name="command">The WinLirc command to send</param> /// <exception cref="WinLircCommandNotSupportedException">If the given command is not supported by the device</exception> public void SendWinLircCommand(WinLircCommand command) { if (!SupportsWinLircCommand(command)) { throw new WinLircCommandNotSupportedException(command); } else { var commandString = Enum.GetName(typeof(WinLircCommand), command).ToLower(); var remoteAndCommand = _winLircCommands[commandString]; this.SendWinLircCommand(remoteAndCommand.Item1, remoteAndCommand.Item2); } }
public WinLircCommandNotSupportedException(WinLircCommand command, string message) : base(message) { Command = command; }
public WinLircCommandNotSupportedException(WinLircCommand command) : base() { Command = command; }
/// <summary> /// Checks for support of a WinLirc command /// </summary> /// <param name="command">The WinLircCommand to check</param> /// <returns>True if this device supports the given WinLirc command, otherwise false</returns> public bool SupportsWinLircCommand(WinLircCommand command) { return(this.SupportsWinLircCommand( Enum.GetName(typeof(WinLircCommand), command).ToLower() )); }