Exemple #1
0
        private void SendMessage(EventStreamEnum streamId, AllInOneModel msg)
        {
            msg.EventStream = (int)streamId;

            var serialMsg = JsonConvert.SerializeObject(new AllInOneModelDto(msg, _iotDeviceId));
            var message   = new Message(Encoding.UTF8.GetBytes(serialMsg));

            //_sendTasks.RemoveAll(t => t.AsTask().IsCompleted);

            _sendTasks.Add(_myClient.SendEventAsync(message));

            /*            lock(Locker)
             *  _messageBuffer.Add(message);
             *
             * StartTimer();
             * _sendTasks.RemoveAll(t => t.AsTask().IsCompleted);*/
        }
 public AllInOneStep()
 {
     DataContext = _model = new AllInOneModel();
     InitializeComponent();
 }