Click here to Skip to main content
15,886,067 members
Articles / Programming Languages / C#

Dynamically Generated User Defined Interfaces (Part 1)

Rate me:
Please Sign up or sign in to vote.
4.35/5 (11 votes)
26 Nov 2008CPOL6 min read 61.1K   802   109  
An introduction to how we solved the problem of allowing users to define both data structures and user interfaces to edit this data.
// ------------------------------------------------------------------------------
// This class was auto-generated for use with the Habanero Enterprise Framework.
// NB Custom code should be placed in the provided stub class.
// Please do not modify this class directly!
// ------------------------------------------------------------------------------

namespace MachineExample.BO
{
    using System;
    using Habanero.BO;
    using MachineExample.BO;
    
    
    public partial class Machine : BusinessObject
    {
        
        #region Properties
        public virtual Guid? MachineID
        {
            get
            {
                return ((Guid?)(base.GetPropertyValue("MachineID")));
            }
            set
            {
                base.SetPropertyValue("MachineID", value);
            }
        }
        
        public virtual Guid? MachineTypeID
        {
            get
            {
                return ((Guid?)(base.GetPropertyValue("MachineTypeID")));
            }
            set
            {
                base.SetPropertyValue("MachineTypeID", value);
            }
        }
        
        public virtual String MachineNo
        {
            get
            {
                return ((String)(base.GetPropertyValue("MachineNo")));
            }
            set
            {
                base.SetPropertyValue("MachineNo", value);
            }
        }
        #endregion
        
        #region Relationships
        public virtual BusinessObjectCollection<MachineProperty> MachineProperties
        {
            get
            {
                return Relationships.GetRelatedCollection<MachineProperty>("MachineProperties");
            }
        }
        
        public virtual MachineType MachineType
        {
            get
            {
                return Relationships.GetRelatedObject<MachineType>("MachineType");
            }
            set
            {
                Relationships.SetRelatedObject("MachineType", value);
            }
        }
        #endregion
    }
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Chillisoft Solution Services
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions