2017-06-26 22 views

回答

0

您是否嘗試過使用由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類的擴展......

+0

感謝。正是我想要的, – RadarBug

+0

太棒了,請標記爲已接受的答案。 – getsetcode

+0

@RadarBug你也可以在文檔中找到這些精確的代碼示例。 https://docs.kentico.com/api10和https://docs.kentico.com/k10/custom-development/handling-global-events –

相關問題