コード例 #1
0
 internal void FireAsyncMessageReceivedEvent(AsyncMessageEventArgs args)
 {
     if (AsyncMessageReceived != null)
     {
         AsyncMessageReceived(this, args);
     }
 }
コード例 #2
0
        void OnAsyncMessageReceived(object sender, MessageReceivedEventArgs args)
        {
            AsyncMessageEventArgs rpcr = new AsyncMessageEventArgs(args.Message.Body);

            _extensionManager.FireAsyncMessageReceivedEvent(rpcr);
            //args.Result.Body = rpcr.Body;
            args.Message.Body = rpcr.Body;
        }
コード例 #3
0
 void OnAsyncMessageReceived(object sender, MessageReceivedEventArgs args)
 {
     try
     {
         AsyncMessageEventArgs rpcr = new AsyncMessageEventArgs(args.Message.Body);
         _extensionManager.FireAsyncMessageReceivedEvent(rpcr);
         //args.Result.Body = rpcr.Body;
         args.Message.Body = rpcr.Body;
     }
     catch (Exception ex)
     {
         _extensionManager.ConsoleWriteLine($"[{(ex.TargetSite.DeclaringType as IExtension)?.Name ?? ex.TargetSite.DeclaringType.FullName}] threw {ex.GetType().FullName} on async message");
         _extensionManager.ConsoleWriteLine(" --- Stacktrace --- ");
         _extensionManager.ConsoleWriteLine(ex.StackTrace);
         _extensionManager.ConsoleWriteLine(" --- Stacktrace end --- ");
     }
 }
コード例 #4
0
 private void pm_AsyncMessageReceived(object sender, AsyncMessageEventArgs e)
 {
     _dispatcher.InvokeAsync(() => _packetUi.PacketListBox.Items.Add(new AsyncListItem(e.Body)));
 }