コードは自明です:
public class TooLateValidator : IApplicationStartupHandler
{
public TooLateValidator()
{
ContentService.Saving += ContentService_Saving;
}
private void ContentService_Saving(IContentService sender, Umbraco.Core.Events.SaveEventArgs<Umbraco.Core.Models.IContent> e)
{
if(DateTime.Now.Hour > 21){
e.Cancel = true;
//validation message: "it's too late for that"
// how do I throw this message to UI??
}
}
}
アンブラコ6を使用しています。