Server/Actions/ActionCecInactiveSource.cs
author StephaneLenclud
Fri, 29 Jul 2016 14:33:47 +0200
changeset 228 6a84d8282226
parent 223 f6272f65d8fc
child 231 4c706feaf706
permissions -rw-r--r--
Adding test action button to edit action form.
Action.DoExecute now protected.
     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     [DataContract]
    13     [AttributeAction(Id = "Cec.InactiveSource", Name = "CEC Inactive Source", Description = "Set this CEC device as inactive source.")]
    14     class ActionCecInactiveSource : SharpLib.Ear.Action
    15     {
    16         protected override void DoExecute()
    17         {
    18             if (Cec.Client.Static == null)
    19             {
    20                 Console.WriteLine("WARNING: No CEC client installed.");
    21                 return;
    22             }
    23 
    24             Cec.Client.Static.Lib.SetInactiveView();
    25         }
    26     }
    27 }