Server/Actions/ActionCecClose.cs
author StephaneLenclud
Thu, 25 Aug 2016 00:42:09 +0200
changeset 253 2dae7a163fff
parent 231 4c706feaf706
child 258 e237c2e33545
permissions -rw-r--r--
Published v1.0.0.0
Updating Harmony library to v0.4.0 for keep alive support.
Improved logs mechanism.
     1 using CecSharp;
     2 using SharpLib.Ear;
     3 using System;
     4 using System.Collections.Generic;
     5 using System.Diagnostics;
     6 using System.Linq;
     7 using System.Runtime.Serialization;
     8 using System.Text;
     9 using System.Threading.Tasks;
    10 
    11 namespace SharpDisplayManager
    12 {
    13     [DataContract]
    14     [AttributeObject(Id = "Cec.Close", Name = "CEC Close", Description = "Close CEC connection.")]
    15     class ActionCecClose : SharpLib.Ear.Action
    16     {
    17         protected override void DoExecute()
    18         {
    19             if (Cec.Client.Static == null)
    20             {
    21                 Trace.WriteLine("WARNING: No CEC client installed.");
    22                 return;
    23             }
    24 
    25             Cec.Client.Static.Close();
    26         }
    27     }
    28 }