StephaneLenclud@214:  StephaneLenclud@214: using CecSharp; StephaneLenclud@214: using SharpLib.Ear; StephaneLenclud@214: using System; StephaneLenclud@214: using System.Collections.Generic; StephaneLenclud@214: using System.Linq; StephaneLenclud@214: using System.Runtime.Serialization; StephaneLenclud@214: using System.Text; StephaneLenclud@214: using System.Threading.Tasks; StephaneLenclud@214: StephaneLenclud@214: namespace SharpDisplayManager StephaneLenclud@214: { StephaneLenclud@214: [DataContract] StephaneLenclud@214: [AttributeAction(Id = "Cec.SendKepressTvPowerOff", Name = "CEC Send Keypress TV Power Off", Description = "Send Power Off keypress to your TV.")] StephaneLenclud@214: class ActionCecSendKeypressTvPowerOff : SharpLib.Ear.Action StephaneLenclud@214: { StephaneLenclud@214: public override void Execute() StephaneLenclud@214: { StephaneLenclud@214: if (Cec.Client.Static == null) StephaneLenclud@214: { StephaneLenclud@214: Console.WriteLine("WARNING: No CEC client installed."); StephaneLenclud@214: } StephaneLenclud@214: StephaneLenclud@214: Cec.Client.Static.Lib.SendKeypress(CecLogicalAddress.Tv,CecUserControlCode.PowerOffFunction,true); StephaneLenclud@214: } StephaneLenclud@214: } StephaneLenclud@214: }