向文档添加相关页面时的事件
Event when adding a related page to a document
除了 LogChange 之外,当 adding/deleting 文档的相关页面时是否会触发更具体的事件?
我希望在发生这种情况时能够从缓存中删除页面
您是否尝试过使用 CMS.DocumentEngine.RelationshipInfo.TYPEINFO.Events
属性 定义的全局事件?例如:
public class CustomRelationshipEvents : CMSLoaderAttribute
{
public override void Init()
{
RelationshipInfo.TYPEINFO.Events.Insert.After += Insert_After;
}
private void Insert_After(object sender, ObjectEventArgs e)
{
// Clear cache here
}
}
然后将您的 CustomRelationshipEvents
属性添加到 Kentico 的扩展 CMSModuleLoader
class...
除了 LogChange 之外,当 adding/deleting 文档的相关页面时是否会触发更具体的事件?
我希望在发生这种情况时能够从缓存中删除页面
您是否尝试过使用 CMS.DocumentEngine.RelationshipInfo.TYPEINFO.Events
属性 定义的全局事件?例如:
public class CustomRelationshipEvents : CMSLoaderAttribute
{
public override void Init()
{
RelationshipInfo.TYPEINFO.Events.Insert.After += Insert_After;
}
private void Insert_After(object sender, ObjectEventArgs e)
{
// Clear cache here
}
}
然后将您的 CustomRelationshipEvents
属性添加到 Kentico 的扩展 CMSModuleLoader
class...