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