コード例 #1
0
        public void UpdateChicagoMessage(ChicagoMessage message)
        {
            if (message == null)
            {
                return;
            }

            _latestChicagoMessage = message;
            SendMessageToHub(_latestChicagoMessage);
        }
コード例 #2
0
 private void InitializeMessages()
 {
     _latestContextMessage = new ContextMessage
     {
         GeoFilter  = GeoFilter.All,
         TimeFilter = DateTime.Today
     };
     _latestSummaryMessage = new SummaryMessage()
     {
         IsDefault = true
     };
     _latestTemperatureMessage = new TemperatureMessage()
     {
         IsDefault = true
     };
     _latestHeartRateMessage = new HeartRateMessage()
     {
         IsDefault = true
     };
     _latestOxygenMessage = new OxygenMessage()
     {
         IsDefault = true
     };
     _latestBostonMessage = new BostonMessage()
     {
         IsDefault = true
     };
     _latestChicagoMessage = new ChicagoMessage()
     {
         IsDefault = true
     };
     _latestNewYorkMessage = new NewYorkMessage()
     {
         IsDefault = true
     };
     _latestGlucoseMessage = new GlucoseMessage()
     {
         IsDefault = true
     };
     _sendToGroup = new Dictionary <string, Action>()
     {
         { GetMessageMetadata <ContextMessage>().Group, () => SendMessageToHub(LatestContextMessage) },
         { GetMessageMetadata <SummaryMessage>().Group, () => SendMessageToHub(LatestSummaryMessage) },
         { GetMessageMetadata <TemperatureMessage>().Group, () => SendMessageToHub(LatestTemperatureMessage) },
         { GetMessageMetadata <OxygenMessage>().Group, () => SendMessageToHub(LatestOxygenMessage) },
         { GetMessageMetadata <GlucoseMessage>().Group, () => SendMessageToHub(LatestGlucoseMessage) },
         { GetMessageMetadata <HeartRateMessage>().Group, () => SendMessageToHub(LatestHeartRateMessage) },
         { GetMessageMetadata <BostonMessage>().Group, () => SendMessageToHub(LatestBostonMessage) },
         { GetMessageMetadata <ChicagoMessage>().Group, () => SendMessageToHub(LatestChicagoMessage) },
         { GetMessageMetadata <NewYorkMessage>().Group, () => SendMessageToHub(LatestNewYorkMessage) }
     };
 }