예제 #1
0
        private void OnSessionCompleted(object sender, SessionCompletingEventArgs e)
        {
            if (_channels == null || e.Session.IsAborted)
            {
                return;
            }

            PlatformServices.Current.Parallel_ForEach(_channels, channel => channel.SendEvents(e.Session));
        }
예제 #2
0
        private void OnSessionCompleting(object sender, SessionCompletingEventArgs e)
        {
            if (e.Session.IsAborted)
            {
                return;
            }

            foreach (var elem in e.Session.TrackingData.GetTrackedElementsByState(TrackingState.Removed))
            {
                IModelElement weak;
                if (_cache.TryRemove(elem.Id, out weak) && weak is IDisposable)
                {
                    ((IDisposable)weak).Dispose();
                }
            }
        }
        private void OnSessionCompleted(object sender, SessionCompletingEventArgs e)
        {
            _sync.EnterWriteLock();

            try
            {
                _activeSessions.Remove(e.Session.SessionId);
                foreach (var swap in _domainModels)
                {
                    swap.OnSessionCompleted(e.Session.SessionId);
                }

                _domainModels.RemoveAll(m => m.IsEmpty);
            }
            finally
            {
                _sync.ExitWriteLock();
            }
        }
예제 #4
0
 void SessionCompleting(object sender, SessionCompletingEventArgs e)
 {
     OnSessionCompleted(e.Session.SessionId);
 }