Beispiel #1
0
        private async Task Progress(long idGroup, SendingState sendingState)
        {
            var currentSendingState = sendingStates.FirstOrDefault(x => x.Item1 == idGroup && x.Item2.IdMessaging == sendingState.IdMessaging);

            if (currentSendingState == null)
            {
                sendingStates.Add(new Pair <long, SendingState>(idGroup, sendingState));
            }
            else
            {
                currentSendingState.Item2.Total    = sendingState.Total;
                currentSendingState.Item2.Progress = sendingState.Progress;
            }
            await Clients.Group(idGroup.ToString()).SendAsync("ProgressChanged", sendingState);
        }
 static LoggerPipe()
 {
     lockState = new SendingState();
 }
 private void OnStateChanged(SendingState newState)
 {
     if (SendStateChanged != null)
         Task.Factory.StartNew(() =>
         {
             SendStateChanged(this, newState);
         });
 }