Registering providers using assembly attributes

The most direct way to register custom providers, helpers or managers is using assembly attributes.

  1. Edit your provider class.

  2. Add a using statement for the CMS namespace:

    
    
    
     using CMS;
    
    
     
  3. Register your custom providers by adding assembly attributes above the class declaration, for providers, helpers or managers respectively:

    • RegisterCustomProvider
    • RegisterCustomHelper
    • RegisterCustomManager

The parameter of each attribute must contain the exact type of the corresponding custom class (specified as a System.Type object).

You can assign classes from both App_Code and other assemblies.

The customization automatically targets the provider object that matches the parent of the specified custom class.

Example



// Registers two custom providers, a helper and a manager
[assembly: RegisterCustomProvider(typeof(CustomEmailProvider))]
[assembly: RegisterCustomProvider(typeof(CMS.CustomProviders.CustomForumPostInfoProvider))]
[assembly: RegisterCustomHelper(typeof(CustomCacheHelper))]
[assembly: RegisterCustomManager(typeof(CustomWorkflowManager))]



The system now uses your customized providers instead of the default functionality.