public ToUpperOp(string name) : base(name) { var ebc = new ToUpperEBC(); ebc.Result += _ => { var continueWith = (Action <IMessage>)Thread.GetData( Thread.GetNamedDataSlot("continueWith") ); continueWith(new Message(base.Name, _)); }; _adapter = (input, continueWith, unhandledException) => { Thread.AllocateNamedDataSlot("continueWith"); Thread.SetData(Thread.GetNamedDataSlot("continueWith"), continueWith); try { ebc.Process((string)input.Data); } finally { Thread.FreeNamedDataSlot("continueWith"); } }; }
public ToUpperOp(string name) : base(name) { var ebc = new ToUpperEBC(); ebc.Result += _ => { var continueWith = (Action<IMessage>)Thread.GetData(Thread.GetNamedDataSlot("continueWith")); continueWith(new Message(base.Name, _)); }; _adapter = (input, continueWith, unhandledException) => { Thread.AllocateNamedDataSlot("continueWith"); Thread.SetData(Thread.GetNamedDataSlot("continueWith"), continueWith); try { ebc.Process((string) input.Data); } finally { Thread.FreeNamedDataSlot("continueWith"); } }; }