コード例 #1
0
ファイル: Notice.cs プロジェクト: brandonc/nbroadcast
 private void SendInternal(BroadcastAsyncResult ar)
 {
     foreach (Type tm in this.GetMedia())
     {
         var m = (IMedium)Activator.CreateInstance(tm);
         try
         {
             if (ar != null)
                 m.DispatchAsync(this.Message, ar);
             else
                 m.Dispatch(this.Message);
         } catch (NoticeDispatchException)
         {
             if (!MuteExceptions)
                 throw;
         }
     }
 }
コード例 #2
0
ファイル: Notice.cs プロジェクト: brandonc/nbroadcast
        // Asynchronous deliver uses the application thread pool. If the application quits, remaining delivery is cancelled.
        public BroadcastAsyncResult SendAsync()
        {
            var ar = new BroadcastAsyncResult(this.GetMedia());

            DelayInternal(this.noticedelay, () => {
                SendInternal(ar);
            });

            return ar;
        }