/// <summary>
 /// Creates the various properties for this class.
 /// </summary>
 private void CreateProperties(CodeTypeDeclaration ctd)
 {
     // Go through the properties
     foreach (string propName in properties.Keys)
     {
         // Get our fields
         TemplateVariable var   = (TemplateVariable)properties[propName];
         Type             type  = var.Type;
         string           cname = var.ContextName;
         //Debug("Creating {0}: {1} (from {2}", propName, type,
         //cname);
         CreateProperty(ctd, propName, cname, type.Name);
     }
 }
        /// <summary>
        /// Registers a variable (and a type) for the template. This is
        /// used to create local variables on the class that directly pull
        /// from the context. If a null type is given, it is removed.
        /// </summary>
        public void Register(
            string propertyName, string contextName, Type type)
        {
            // Check for null
            if (type == null)
            {
                properties.Remove(propertyName);
            }

            // Create the entry
            TemplateVariable var = new TemplateVariable(contextName, type);

            properties[propertyName] = var;
        }
        /// <summary>
        /// Registers a variable (and a type) for the template. This is
        /// used to create local variables on the class that directly pull
        /// from the context. If a null type is given, it is removed.
        /// </summary>
        public void Register(
            string propertyName, string contextName, Type type)
        {
            // Check for null
            if (type == null)
                properties.Remove(propertyName);

            // Create the entry
            TemplateVariable var = new TemplateVariable(contextName, type);
            properties[propertyName] = var;
        }