コード例 #1
0
 private void AgentAsyncCompletionCallback(AgentAsyncContext context)
 {
     if (this.resumeAgentCallback != null && this.resumeAgentCallback())
     {
         MExDiagnostics.EventLog.LogEvent(EdgeExtensibilityEventLogConstants.Tuple_MExAgentDidNotCallResume, this.lastAgentName, new object[]
         {
             this.lastAgentName,
             this.eventTopic
         });
     }
     ExTraceGlobals.DispatchTracer.TraceDebug <string, string>((long)this.GetHashCode(), this.InstanceNameFormatted + "async completed, async result {0}, exception {1}", this.isSyncInvoke ? "n/a" : this.pendingResult.GetHashCode().ToString(CultureInfo.InvariantCulture), (context.AsyncException == null) ? "n/a" : context.AsyncException.GetType().FullName);
     if (this.isSyncInvoke)
     {
         if (context.AsyncException != null)
         {
             MExAsyncResult.WrapAndRethrowException(context.AsyncException, new LocalizedString(MExRuntimeStrings.AgentFault(this.currentAgent.Name, this.eventTopic)));
         }
         this.syncWaitHandle.Set();
         return;
     }
     if (context.AsyncException != null)
     {
         this.pendingResult.AsyncException = context.AsyncException;
         this.HaltExecution();
         MExSession.LogMexAgentFaultEvent(MExDiagnostics.EventLog, context.AsyncException, this.currentAgent.Name, this.eventTopic);
     }
     if (this.completeAsyncAgentCallback != null)
     {
         this.completeAsyncAgentCallback();
     }
     this.Dispatcher.AgentInvokeCompleted(this);
     this.ResumeExecution();
 }
コード例 #2
0
 private void HandleLeakedException(Exception e)
 {
     this.pendingResult.EventTopic      = this.eventTopic;
     this.pendingResult.FaultyAgentName = this.currentAgent.Name;
     this.pendingResult.AsyncException  = e;
     ExTraceGlobals.DispatchTracer.TraceError((long)this.GetHashCode(), this.InstanceNameFormatted + e);
     MExSession.LogMexAgentFaultEvent(MExDiagnostics.EventLog, e, this.currentAgent.Name, this.eventTopic);
 }