Implementing the IExplicitInstrumentationBinder interface

Topics: General discussion
Apr 25, 2007 at 8:46 PM
Edited Apr 25, 2007 at 8:47 PM
Hi. I have a class called ContentManagementInstrumentationBinder that implements IExplicitInstrumentationBinder. Here's the code:

using Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation;
namespace ADC.CMS.Instrumentation
{
/// <summary>
/// This type supports the Enterprise Library infrastructure and is not intended to be used directly from your code.
/// Explicit binder for CMS instrumentation.
/// </summary>
public class ContentManagementInstrumentationBinder: IExplicitInstrumentationBinder
{
#region IExplicitInstrumentationBinder Members
/// <summary>
/// Binds the events exposed by the source to the handlers in the listener.
/// </summary>
/// <param name="source">The source of instrumentation events. Must be an instance of <see cref="ContentManagementGlobalizationProvider"/>.</param>
/// <param name="listener">The listener for instrumentation events. Must be an instance of <see cref="ContentManagementInstrumentationListener"/>.</param>
public void Bind(object source, object listener)
{
ContentManagementInstrumentationProvider castedProvider = (ContentManagementInstrumentationProvider)source;
ContentManagementInstrumentationListener castedListener = (ContentManagementInstrumentationListener)listener;

castedProvider.CMSAuthorizationDeniedEvent += castedListener.CMSAuthorizationDeniedEventHandler;
castedProvider.ContentApprovedEvent += castedListener.ContentApprovedEventHandler;
castedProvider.ContentLockFailedEvent += castedListener.ContentLockFailedEventHandler;
castedProvider.ContentLockSucceededEvent += castedListener.ContentLockSucceededEventHandler;
castedProvider.ContentPublishedEvent += castedListener.ContentPublishedEventHandler;
castedProvider.ContentRejectedEvent += castedListener.ContentRejectedEventHandler;
castedProvider.ContentRetrievalFailedEvent += castedListener.ContentRetrievalFailedEventHandler;
castedProvider.ContentRetrievalSucceededEvent += castedListener.ContentRetrievalSucceededEventHandler;
castedProvider.ContentWorkflowFailedEvent += castedListener.ContentWorkflowFailedEventHandler;
}
#endregion

}
}

I am attempting to fire the events referenced in the Bind() method in the snippet above from another class. Supposedly, the Enterprise Library will call the Bind() method automagically, but it isn't happening. What am I missing? Thanks.