public void ToDisconnected() { Context.IDisconnected context = _contextFactory.ForDisconnected(); Event.Transition message = _eventFactory.ForStateTransition(context); _eventMediator.Publish(message); }
public async void OnEnter() { Command.Response.Rosta rosta = await _context.CommandEndpoint.Send(new Command.Request.GetRosta()); List <Command.Response.Device> devices = new List <Command.Response.Device>(); try { foreach (Tuple <int, string> device in rosta.Devices) { devices.Add(await _context.CommandEndpoint.Send(new Command.Request.GetDevice(device.Item1))); } _mediator.Publish(new Gateway.Event.Connected(_context.Name, _context.Remarks, _context.MacAddress, devices)); ToListenting(); } catch (Exception exception) { ToFault(exception); } }
public void OnEnter() { _eventMediator.Publish(new Gateway.Event.Errored(_context.Exception)); Instrumentation.State.Machine.Faulted(_context.Exception); }
private void Publish(Packet.IReading reading) { _eventMediator.Publish(new Gateway.Event.Reading(reading)); }