using System;
using Habanero.Faces.Base;
using <<|=UIBaseProjectName|>>;

namespace <<|=ProjectName|>>.Menu
{
    public class <<|=ControlName|>>MenuItem : MenuItemCreator
    {
        public override void AddToMenu(HabaneroMenu currentMenu, IControlFactory controlFactory)
        {
            if (controlFactory == null) throw new ArgumentNullException("controlFactory");
            HabaneroMenu.Item menuItem = currentMenu.AddMenuItem("<<|=ClassName+|>> (<<|=ControlName|>>)");
            menuItem.FormControlCreator += delegate { return ((I<<|=ProjectName|>>ControlFactory)controlFactory).Create<<|=ControlName|>>(); ; };
        }
    }
}
