Server/Actions/ActionCecDevicePowerOn.cs
author StephaneLenclud
Sun, 21 Aug 2016 16:35:20 +0200
changeset 249 cadc4e4302c6
parent 228 6a84d8282226
child 253 2dae7a163fff
permissions -rw-r--r--
Removing now redundant specific HID EAR events.
     1 using CecSharp;
     2 using SharpLib.Ear;
     3 using System;
     4 using System.Collections.Generic;
     5 using System.Linq;
     6 using System.Runtime.InteropServices;
     7 using System.Runtime.Serialization;
     8 using System.Text;
     9 using System.Threading.Tasks;
    10 
    11 namespace SharpDisplayManager
    12 {
    13     [DataContract]
    14     [AttributeObject(Id = "Cec.Device.PowerOn", Name = "CEC Device Power On", Description = "Turns on the specified CEC device on your HDMI bus.")]
    15     public class ActionCecDevicePowerOn : ActionCecDevice
    16     {
    17         /// <summary>
    18         /// 
    19         /// </summary>
    20         /// <returns></returns>
    21         public override string Brief()
    22         {
    23             return "CEC Power On " + DeviceName;
    24         }
    25 
    26         /// <summary>
    27         /// 
    28         /// </summary>
    29         protected override void DoExecute()
    30         {
    31             if (Cec.Client.Static == null)
    32             {
    33                 Console.WriteLine("WARNING: No CEC client installed.");
    34                 return;
    35             }
    36 
    37             Cec.Client.Static.Lib.PowerOnDevices(Device);
    38         }
    39     }
    40 }