EventBroker: How to trace all events passed through EventBroker

Topics: CAB & Smart Client Software Factory
May 8, 2007 at 9:37 AM

Is there a way to trace/log all events fired through EventBroker?

May 8, 2007 at 10:04 AM
Hi Leonid,

Yup, the EventBroker code inside ComponentUI writes to the standard Trace stream.

You can add a Trace Listener through the system.Diagnostics configuration section to listen for the trace events...
The class is something like Microsoft.Practices.ComponentUI.EventBroker.EventTopic (if you have reflector have a look in the ComponentUI assembly. It has events like Fire which all write to trace.

Sorry but I don't have reflector near me so can't be any more precise! It works though. I did it earlier today!!


May 9, 2007 at 10:07 AM
Isn't it easier to just read the source code ? :-P

May 9, 2007 at 3:29 PM
yeah :)
I've found the trace source name to listen

      <source name="Microsoft.Practices.ObjectBuilder" switchName="Switch1">
          <add name="Console" type="System.Diagnostics.ConsoleTraceListener" />
      <add name="Switch1" value="Information" />