4 using System.Collections.Generic;
5 using System.Diagnostics;
7 using System.Runtime.Serialization;
9 using System.Threading.Tasks;
11 namespace SharpDisplayManager
14 [AttributeObject(Id = "Cec.ActiveSource", Name = "CEC Active Source", Description = "Set this CEC device as active source.")]
15 class ActionCecActiveSource : ActionCecDeviceType
18 /// Build a user readable string to describe this action.
20 /// <returns></returns>
21 public override string Brief()
23 return "CEC Active Source to " + DeviceType.ToString();
27 /// Set the defined device type as active source.
29 protected override async Task DoExecute()
31 if (Cec.Client.Static == null)
33 Trace.WriteLine("WARNING: No CEC client installed.");
37 Cec.Client.Static.Lib.SetActiveSource(DeviceType);