using System;
using CMS.SettingsProvider;
using CMS.CMSImportExport;
using CMS.DocumentEngine;
using CMS.GlobalHelper;
///
/// Sample handler module.
///
[SampleHandlerModuleLoader]
public partial class CMSModuleLoader
{
// You can copy additional samples from the \CodeSamples\App_Code Samples\ folder in your
// Kentico CMS installation directory (by default C:\Program Files\KenticoCMS\).
#region "Macro methods loader attribute"
///
/// Module registration
///
private class SampleHandlerModuleLoader : CMSLoaderAttribute
{
///
/// Initializes the module
///
public override void Init()
{
//DocumentEvents.Insert.Before += new EventHandler(Insert_Before);
}
///
/// Sample before insert handler which uppercases the document name
///
protected void Insert_Before(object sender, DocumentEventArgs e)
{
var doc = e.Node;
doc.DocumentName = doc.DocumentName.ToUpper();
}
}
#endregion
}