Server/Actions/ActionCecDevicePowerOn.cs
author StephaneLenclud
Fri, 12 Aug 2016 20:25:05 +0200
changeset 231 4c706feaf706
parent 228 6a84d8282226
child 253 2dae7a163fff
permissions -rw-r--r--
Events can now be instantiated.
Action editor is now a generic object editor.
     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 }