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

Win-Form/Web-Form Generic Components using the same Controller

Rate me:
Please Sign up or sign in to vote.
4.00/5 (7 votes)
5 Oct 2008CPOL7 min read 43.1K   1.1K   36  
A framework to develop Win-Form and Web-Form applications using generic components
using System;
using System.Text;

namespace Framework.baInterfaces
{
    /// <summary>
    /// The various kinds of Parent/Child relation 
    /// </summary>
    public enum RelationKind
    {
        Null, MasterDetail, Lookup
    }

    /// <summary>
    /// Make relation between two Binding Managers
    /// </summary>
    public interface IBindingRelation
    {
        /// <summary>
        /// BindingRelation classes are implementing IBindable that 
        /// had Bind method but not visible to instances explicitly
        /// </summary>
        void Bind();

        /// <summary>
        /// Define a Binding Manage as the parent(master) of the relation
        /// </summary>
        IBindingManager MasterBindingManager
        {
            get;
            set;
        }

        /// <summary>
        /// Define a Binding Manage as the children(detail) of the relation
        /// </summary>
        IBindingManager DetailBindingManager
        {
            get;
            set;
        }

        /// <summary>
        /// The Primary Key of the Master Table
        /// </summary>
        object MasterPrimaryKey
        {
            get;
            set;
        }

        /// <summary>
        /// The foreign key of the Detail Table
        /// </summary>
        object DetailForeignKey
        {
            get;
            set;
        }

        /// <summary>
        /// Define the kind of relation to control the 
        /// Binding Managers behaviour base on selection
        /// </summary>
        RelationKind Relation
        {
            get;
            set;
        }

        /// <summary>
        /// When binding relation kind changed
        /// </summary>
        event EventHandler RelationChanged;
    }
}

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 (Senior)
Canada Canada
Software development experience since 1993

Skills
- Programming Languages: C# .NET, Delphi, C++, Java and VB
- Development Methodologies (SDLC): RUP, Scrum and XP
- Database: SQL server, Oracle, Apollo database and MS Access.

Educations & Certificates
- Microsoft® Certified Professional (MCP)
- Sun® Certified Java2 Programmer
- B.S. in computer science

Comments and Discussions