public IMessage SyncProcessMessage(IMessage msg) { try { LogicalCallContext oldcctx = Message.PropagateCallContextFromMessageToThread(msg); if (this._delegate != null) { this._delegate(); } else { CallBackHelper @object = new CallBackHelper(this._eeData, true, this._targetDomainID); CrossContextDelegate crossContextDelegate = new CrossContextDelegate(@object.Func); crossContextDelegate(); } Message.PropagateCallContextFromThreadToMessage(msg, oldcctx); } catch (Exception e) { ReturnMessage returnMessage = new ReturnMessage(e, new ErrorMessage()); returnMessage.SetLogicalCallContext((LogicalCallContext)msg.Properties[Message.CallContextKey]); return(returnMessage); } return(this); }
public IMessage SyncProcessMessage(IMessage msg) { try { LogicalCallContext thread = Message.PropagateCallContextFromMessageToThread(msg); if (this._delegate != null) { this._delegate(); } else { new CrossContextDelegate(new CallBackHelper(this._eeData, true, this._targetDomainID).Func)(); } Message.PropagateCallContextFromThreadToMessage(msg, thread); } catch (Exception ex) { ErrorMessage errorMessage = new ErrorMessage(); ReturnMessage returnMessage = new ReturnMessage(ex, (IMethodCallMessage)errorMessage); LogicalCallContext ctx = (LogicalCallContext)msg.Properties[(object)Message.CallContextKey]; returnMessage.SetLogicalCallContext(ctx); return((IMessage)returnMessage); } return((IMessage)this); }
internal static void PropagateCallContextFromThreadToMessage(IMessage msg, LogicalCallContext oldcctx) { Message.PropagateCallContextFromThreadToMessage(msg); CallContext.SetLogicalCallContext(oldcctx); }