Server/Actions/ActionCecDevice.cs
author StephaneLenclud
Wed, 17 Aug 2016 16:39:36 +0200
changeset 237 1a1c2ae3a29c
parent 222 0e8c6c2f4777
permissions -rw-r--r--
Adding HID consumer control event.
     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     /// <summary>
    14     /// Abstract CEC action using a device logical address.
    15     /// </summary>
    16     [DataContract]
    17     public abstract class ActionCecDevice: SharpLib.Ear.Action
    18     {
    19         [DataMember]
    20         [AttributeObjectProperty
    21             (
    22             Id = "CEC.Device",
    23             Name = "Device",
    24             Description = "The logical address used by this action."
    25             )
    26         ]
    27         public CecLogicalAddress Device { get; set; }
    28 
    29         /// <summary>
    30         /// 
    31         /// </summary>
    32         public string DeviceName {
    33             get
    34             {
    35                 if (Device == CecLogicalAddress.Broadcast)
    36                 {
    37                     //Because of duplicate value in enumeration
    38                     return "Broadcast";
    39                 }
    40 
    41                 return Device.ToString();
    42             }
    43         }
    44 
    45     }
    46 }