Server/Actions/ActionCecScan.cs
author StephaneLenclud
Sun, 21 Aug 2016 16:30:58 +0200
changeset 248 0220cb84df58
parent 228 6a84d8282226
child 253 2dae7a163fff
permissions -rw-r--r--
Fixing EAR event edition.
EAR HID event now displays 'Press a key' if not valid.
     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     [AttributeObject(Id = "Cec.Scan", Name = "CEC Scan", Description = "Scan devices on your CEC HDMI network.")]
    15     class ActionCecScan : SharpLib.Ear.Action
    16     {
    17         protected override void DoExecute()
    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 }