Click here to Skip to main content
15,894,646 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;

namespace Framework.baInterfaces
{
    /// <summary>
    /// Identify the kind of operation 
    /// this control is doing
    /// </summary>
    public enum ComponentUsage
    {
        None, Search, Use
    }
	/// <summary>
	/// Summary description for State.
	/// </summary>
	public class State: IState
	{
		private bool bEnabled;
		private string sText;
		private System.Drawing.Color oColor;
        private System.Windows.Forms.Cursor oCursor;

        #region State Management
        public State(){}

        public State(bool enable, string text, System.Drawing.Color color, System.Windows.Forms.Cursor cursor)
        {
            bEnabled = enable;
            sText = text;
            oColor = color;
            oCursor = cursor;
        }

        public State(bool enable, string text, System.Drawing.Color color)
        {
            bEnabled = enable;
            sText = text;
            oColor = color;
        }

        public State(bool enable, string text)
        {
            bEnabled = enable;
            sText = text;
        }

        public State(bool enable)
        {
            bEnabled = enable;
        }

        public System.Windows.Forms.Cursor Cursor
        {
            get
            {
                return oCursor;
            }
            set
            {
                oCursor = value;
            }
        }

		public bool Enabled
		{
			get
			{
				return bEnabled;
			}
			set
			{
				bEnabled = value;
			}
		}
	
		public string Text
		{
			get
			{
				return sText;
			}
			set
			{
				sText = value;
			}
		}

		public System.Drawing.Color ForeColor
		{
			get
			{
				return oColor;
			}
			set
			{
				oColor = 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 (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