public void OnStatusUpdated(ITaskStatusUpdatedMessage message) { var connectionIds = _storage.Get(message.ProjectId, message.CreatorId); switch (message.Status) { case TaskStatus.Completed: _tasksHubClient.SendAsync("TASK_COMPLETED", message.TaskId, connectionIds); break; case TaskStatus.Removed: _tasksHubClient.SendAsync("TASK_DELETED", message.TaskId, connectionIds); break; } }
/// <summary> /// Handles the Elapsed event of the ConfigUpdateTimer control. /// Saves changed to the underlying config and sends an update to the bus if any changes have occured. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ElapsedEventArgs"/> instance containing the event data.</param> async void ConfigUpdateTimer_Elapsed(object sender, ElapsedEventArgs e) { if (roomsChanged) { roomsChanged = false; try { await hub.SendAsync(Rooms, MethodType.Update); await config.WriteConfigAsync(Rooms); } catch { } } }
private Task UpdateFixtureRegister(Motion fixture) => hubClient.SendAsync(new[] { fixture.MeasuredMotion }, EventBus.Messaging.MethodType.Update, "FixtureRegister");
private Task UpdateFixtureRegister(Temperature fixture) => hubClient.SendAsync(new[] { fixture.MeasuredTemperature, fixture.MeasuredHumidity }, EventBus.Messaging.MethodType.Update, "FixtureRegister");