예제 #1
0
        private void Context_OnPulse(object sender, PreservationService.PulseEventArgs e)
        {
            try
            {
                IServicePreservationCallback guest = OperationContext.Current.GetCallbackChannel <IServicePreservationCallback>();

                if (!_callbackList.Contains(guest))
                {
                    _callbackList.Add(guest);
                }

                _callbackList.Where(x => x == guest).ToList().ForEach(
                    delegate(IServicePreservationCallback callback)
                {
                    try
                    {
                        callback.Pulse(e.Method, e.Message, e.Progress);
                    }
                    catch
                    {
                        try { _callbackList.Remove(callback); }
                        catch { }

                        //TODO log
                    }
                });
            }
            catch
            {
                //TODO log
            }
        }
예제 #2
0
 private void PreservationService_OnPulse(object sender, PreservationService.PulseEventArgs e)
 {
     SendNotification(_commandModel.ReferenceId, e.Message, NotifyLevel.Info).Wait();
 }