Server/Actions/ActionCecClose.cs
author StephaneLenclud
Sun, 21 Aug 2016 19:31:08 +0200
changeset 251 f60cfcb98c9a
parent 228 6a84d8282226
child 253 2dae7a163fff
permissions -rw-r--r--
Published v0.12.2.0
Adding setting for Logitech user name.
Improved event tree view update following Harmony connection.
Removed unneeded editable fields from Harmony command action.
     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     [AttributeObject(Id = "Cec.Close", Name = "CEC Close", Description = "Close CEC connection.")]
    14     class ActionCecClose : 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.Close();
    25         }
    26     }
    27 }