Server/Actions/ActionCecDeviceStandby.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.Standby", Name = "CEC Device Standby", Description = "Puts on standby the specified CEC device on your HDMI bus.")]
    15     public class ActionCecDeviceStandby : ActionCecDevice
    16     {
    17         /// <summary>
    18         /// Build a user readable string to describe this action.
    19         /// </summary>
    20         /// <returns></returns>
    21         public override string Brief()
    22         {
    23             return "CEC Standby " + 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.StandbyDevices(Device);
    38         }
    39 
    40     }
    41 }