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

namespace <<|=UIVWGProjectName|>>
{
    /// <summary>
    /// Provides a factory implementation for the controls in this project.
    /// </summary>
    public partial class <<|=ProjectName|>>ControlFactoryVWG : ControlFactoryVWG, I<<|=ProjectName|>>ControlFactory
    {
        public I<<|=ControlName|>> Create<<|=ControlName|>>()
        {
            return new <<|=ControlName|>>VWG(this);
        }
    }
    
    /// <summary>
    /// A parent-child grid control used for adding and editing <<|=ClassName+|>> and their <<|=ChildRelationshipName|>>.
    /// For common functionality between the web and windows
    /// version of the control, add code to <see cref="<<|=ControlName|>>Manager"/>.  To create specific functionality for
    /// a platform, do it here.
    /// </summary>
    public class <<|=ControlName|>>VWG : UserControlVWG, I<<|=ControlName|>>
    {
        public <<|=ControlName|>>VWG(I<<|=ProjectName|>>ControlFactory controlFactory)
        {
            if (controlFactory == null) throw new ArgumentNullException("controlFactory");
            <<|=ControlName|>>Manager manager = new <<|=ControlName|>>Manager(this, controlFactory);
            manager.Initialise();
        }

        /// <summary>
        /// Called whenever the control is placed on a form by the menu system.  Put any initialisation
        /// code in here that must be run whenever the form is displayed.
        /// </summary>
        public void SetForm(IFormHabanero form) { }
    }
}