using MediaBrowser.Common.Kernel; using MediaBrowser.Controller; using MediaBrowser.Model.Logging; using System.ComponentModel.Composition; using System.Threading.Tasks; namespace MediaBrowser.WebDashboard.Api { /// /// Class DashboardInfoWebSocketListener /// [Export(typeof(IWebSocketListener))] class DashboardInfoWebSocketListener : BasePeriodicWebSocketListener { /// /// Gets the name. /// /// The name. protected override string Name { get { return "DashboardInfo"; } } /// /// Initializes a new instance of the class. /// /// The logger. [ImportingConstructor] public DashboardInfoWebSocketListener([Import("logger")] ILogger logger) : base(logger) { } /// /// Gets the data to send. /// /// The state. /// Task{IEnumerable{TaskInfo}}. protected override Task GetDataToSend(object state) { return Task.FromResult(DashboardService.GetDashboardInfo((Kernel)Kernel, Logger)); } } }