Click here to Skip to main content
15,881,803 members
Articles / Web Development / ASP.NET

Template-Based Code Generation with SmartCode

Rate me:
Please Sign up or sign in to vote.
4.82/5 (35 votes)
25 Dec 20067 min read 100.6K   3.5K   121  
SmartCode is a template based code generator.This tutorial describes the process of building a templates to SmartCode
/*
 * Copyright � 2005-2006 Danilo Mendez <danilo.mendez@kontac.net>
 * Adolfo Socorro <ajs@esolutionspr.com>
 * www.kontac.net 
 * All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.
 */

using System;
using System.Collections.Generic;
using System.Text;
using SmartCode.Model;
using SmartCode.Model.Profile;
using SmartCode.Studio.Controls.EditorWrapper;
using System.ComponentModel;
using System.Drawing.Design;

namespace SmartCode.Studio.Controls
{
    internal class ControlPropertyWrapper : PropertyWrapper
    {
        protected ControlBase control;

        internal ControlPropertyWrapper(ExplorerTreeNode treeNode, ControlBase control)
            : base(treeNode)
        {
            this.control = control;
        }

        [DisplayText("PropName", "PropNameDesc", "CommonCategory")]
        public string Name
        {
            get
            {
                return this.control.Name;
            }
        }

        [DisplayText("PropRequired", "ProUnavailabelDesc", "CommonCategory")]
        public bool Required
        {
            get { return this.control.Required; }
            set { this.control.Required = value; }
        }

        [DisplayText("PropIsVisible", "ProUnavailabelDesc", "CommonCategory")]
        public bool IsVisible
        {
            get { return this.control.Visible; }
            set { this.control.Visible = value; }
        }

        [DisplayText("PropJustify", "ProUnavailabelDesc", "CommonCategory")]
        public SmartCode.Model.Profile.ControlBase.JustifyEnum Justify
        {
            get { return this.control.Justify; }
            set { this.control.Justify = value; }
        }

        [DisplayText("PropHeight", "ProUnavailabelDesc", "CommonCategory")]
        public decimal Height
        {
            get { return this.control.Height; }
            set { this.control.Height = value; }
        }

        [DisplayText("PropWidth", "ProUnavailabelDesc", "CommonCategory")]
        public decimal Width
        {
            get { return this.control.Width; }
            set { this.control.Width = value; }
        }


    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Danilo is the creator of SmartRules, a Business Rules Engine. He is an industry consultant working primarily with companies interested in implementing dynamic rules programming concepts to add flexibility to their architectures on web, CE, and desktop platforms. He operates his own website, Kontac, where you will find more information.

To contact Danilo, email him at danilo.mendez@gmail.com.

Comments and Discussions