Kentico CMS 7.0 Integration Guide

Creating a custom subscription class

Creating a custom subscription class

Previous topic Next topic Mail us feedback on this topic!  

Creating a custom subscription class

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

You can create your own subscription class by implementing the IsMatch() method. This can be useful when you want to extend the options of defining the scope.

 

The diagram below illustrates inheritance of existing classes:

 

integrationguide_clip0030

 

Choose one and inherit your subscription from it. Now you have to implement an override of the following method:

 

bool IsMatch(ICMSObject obj, TaskTypeEnum taskType, ref TaskProcessTypeEnum taskProcessType);

 

Your task is to evaluate whether the subscription or more precisely its properties (initialized in constructor) match the properties of obj and the value of taskType. Once they do, you simply initialize taskProcessType (which should be also initialized in constructor of subscription) and return true.