Server/Actions/ActionCecScan.cs
author StephaneLenclud
Wed, 27 Jul 2016 11:07:35 +0200
changeset 222 0e8c6c2f4777
parent 214 4961ede27e0a
child 223 f6272f65d8fc
permissions -rw-r--r--
Adding send and release CEC key actions.
Edit action ComboBox now sorted and selecting proper item.
     1 using CecSharp;
     2 using SharpLib.Ear;
     3 using System;
     4 using System.Collections.Generic;
     5 using System.Linq;
     6 using System.Runtime.Serialization;
     7 using System.Text;
     8 using System.Threading.Tasks;
     9 
    10 namespace SharpDisplayManager
    11 {
    12 
    13     [DataContract]
    14     [AttributeAction(Id = "Cec.Scan", Name = "CEC Scan", Description = "Scan devices on your CEC HDMI network.")]
    15     class ActionCecScan : SharpLib.Ear.Action
    16     {
    17         public override void Execute()
    18         {
    19             if (Cec.Client.Static == null)
    20             {
    21                 Console.WriteLine("WARNING: No CEC client installed.");
    22                 return;
    23             }
    24 
    25             Cec.Client.Static.Scan();
    26         }
    27     }
    28 }