Exemple #1
0
        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;
            }
        }
Exemple #2
0
        /// <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");
Exemple #4
0
 private Task UpdateFixtureRegister(Temperature fixture)
 => hubClient.SendAsync(new[] { fixture.MeasuredTemperature, fixture.MeasuredHumidity }, EventBus.Messaging.MethodType.Update, "FixtureRegister");