Я в основном следую за этим guide, за исключением того, что я пишу код для объектов, а не документов. Вот мой код:Попытка реализовать обработчик CustomObjectEvent
using CMS.TreeEngine;
using CMS.SettingsProvider;
[CustomObjectEvents]
public partial class CMSModuleLoader
{
/// <summary>
/// Attribute class that ensures the loading of custom handlers
/// </summary>
private class CustomObjectEventsAttribute : CMSLoaderAttribute
{
/// <summary>
/// Called automatically when the application starts
/// </summary>
public override void Init()
{
// Assigns custom handlers to the appropriate events
ObjectEvents.GetContent.Execute += Category_Get_Content; //error is here
}
private void Category_Get_Content(object sender, DocumentEventArgs e)
{
// Add custom actions here
}
}
}
Линия выше бросает компиляции ошибки времени:
Ошибка 1 Не удается преобразовать метод группы «Category_Get_Content» для типа без делегата «CMS.SettingsProvider.SimpleObjectHandler». Вы намеревались вызвать метод? C: \ APPLICATIONS \ DEVELOPMENT \ KENTICO6 \ WebPartDev \ wwwroot \ App_Code \ Пустой сайт \ SearchByCategory.cs 22 40 C: ... \ wwwroot \
Любые идеи?