Esempio n. 1
0
        public void ToDisconnected()
        {
            Context.IDisconnected context = _contextFactory.ForDisconnected();
            Event.Transition      message = _eventFactory.ForStateTransition(context);

            _eventMediator.Publish(message);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        public void OnEnter()
        {
            _eventMediator.Publish(new Gateway.Event.Errored(_context.Exception));

            Instrumentation.State.Machine.Faulted(_context.Exception);
        }
Esempio n. 4
0
 private void Publish(Packet.IReading reading)
 {
     _eventMediator.Publish(new Gateway.Event.Reading(reading));
 }