Пример #1
0
        private void OnChange(Event e)
        {
            HttpServiceProgressEvent inEvent = (HttpServiceProgressEvent)e;

            _dict[(HttpConnector)e.Target] = inEvent;

            HttpServiceProgressEvent pe = new HttpServiceProgressEvent(HttpServiceProgressEvent.PROGRESS_CHANGE);

            foreach (HttpServiceProgressEvent progressEvent in _dict.Values)
            {
                if (null == progressEvent)
                {
                    continue;
                }

                pe.Total    += progressEvent.Total;
                pe.Active   += progressEvent.Active;
                pe.Finished += progressEvent.Finished;
            }

#if DEBUG
            if (DebugMode)
            {
                Debug.Log("HttpServiceProgressAggregator: " + pe);
            }
#endif
            DispatchEvent(pe);
        }
Пример #2
0
 private void DispatchStatusEvent()
 {
     if (HasEventListener(HttpServiceProgressEvent.PROGRESS_CHANGE))
     {
         HttpServiceProgressEvent e = new HttpServiceProgressEvent(HttpServiceProgressEvent.PROGRESS_CHANGE)
         {
             Active   = _active.Count,
             Finished = _finished.Count,
             Total    = _queued.Count + _active.Count + _finished.Count
         };
         DispatchEvent(e);
     }
 }
        private void OnChange(Event e)
        {
            HttpServiceProgressEvent inEvent = (HttpServiceProgressEvent) e;

            _dict[(HttpConnector) e.Target] = inEvent;

            HttpServiceProgressEvent pe = new HttpServiceProgressEvent(HttpServiceProgressEvent.PROGRESS_CHANGE);

            foreach (HttpServiceProgressEvent progressEvent in _dict.Values)
            {
                if (null == progressEvent)
                    continue;

                pe.Total += progressEvent.Total;
                pe.Active += progressEvent.Active;
                pe.Finished += progressEvent.Finished;
            }

            #if DEBUG
            if (DebugMode)
                Debug.Log("HttpServiceProgressAggregator: " + pe);
            #endif
            DispatchEvent(pe);
        }
Пример #4
0
 private void DispatchStatusEvent()
 {
     if (HasEventListener(HttpServiceProgressEvent.PROGRESS_CHANGE))
     {
         HttpServiceProgressEvent e = new HttpServiceProgressEvent(HttpServiceProgressEvent.PROGRESS_CHANGE)
         {
             Active = _active.Count,
             Finished = _finished.Count,
             Total = _queued.Count + _active.Count + _finished.Count
         };
         DispatchEvent(e);
     }
 }