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

Using Silverlight in Enterprise: RAD of User Friendly Database Access

Rate me:
Please Sign up or sign in to vote.
4.81/5 (19 votes)
31 Jul 2009CPOL8 min read 58.2K   7K   80  
This article introduces FulcrumWeb RAD Framework - A Silverlight UI Engine to build user friendly database driven applications
/********************************************************************
 *  FulcrumWeb RAD Framework - Fulcrum of your business             *
 *  Copyright (c) 2002-2009 FulcrumWeb, ALL RIGHTS RESERVED         *
 *                                                                  *
 *  THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED      *
 *  FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE        *
 *  COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE       *
 *  AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT  *
 *  AND PERMISSION FROM FULCRUMWEB. CONSULT THE END USER LICENSE    *
 *  AGREEMENT FOR INFORMATION ON ADDITIONAL RESTRICTIONS.           *
 ********************************************************************/

using System;

namespace Framework.Utils
{
	/// <summary>
	/// Clas to use as combobox item.
	/// </summary>
	public class CxComboItem : IComparable, IConvertible
  {
    #region IConvertible implementation

	  /// <summary>
	  /// Returns the <see cref="T:System.TypeCode"/> for this instance.
	  /// </summary>
	  /// <returns>
	  /// The enumerated constant that is the <see cref="T:System.TypeCode"/> of the class or value type that implements this interface.
	  /// </returns>
	  /// <filterpriority>2</filterpriority>
	  public TypeCode GetTypeCode()
	  {
      return TypeCode.String;
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A Boolean value equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public bool ToBoolean(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A Unicode character equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public char ToChar(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 8-bit signed integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public sbyte ToSByte(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 8-bit unsigned integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public byte ToByte(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 16-bit signed integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public short ToInt16(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 16-bit unsigned integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public ushort ToUInt16(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 32-bit signed integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public int ToInt32(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 32-bit unsigned integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public uint ToUInt32(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 64-bit signed integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public long ToInt64(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An 64-bit unsigned integer equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public ulong ToUInt64(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A single-precision floating-point number equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public float ToSingle(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A double-precision floating-point number equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public double ToDouble(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent <see cref="T:System.Decimal"/> number using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A <see cref="T:System.Decimal"/> number equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public decimal ToDecimal(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent <see cref="T:System.DateTime"/> using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A <see cref="T:System.DateTime"/> instance equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public DateTime ToDateTime(IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an equivalent <see cref="T:System.String"/> using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// A <see cref="T:System.String"/> instance equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public string ToString(IFormatProvider provider)
	  {
      return ToString();
	  }

	  /// <summary>
	  /// Converts the value of this instance to an <see cref="T:System.Object"/> of the specified <see cref="T:System.Type"/> that has an equivalent value, using the specified culture-specific formatting information.
	  /// </summary>
	  /// <returns>
	  /// An <see cref="T:System.Object"/> instance of type <paramref name="conversionType"/> whose value is equivalent to the value of this instance.
	  /// </returns>
	  /// <param name="conversionType">The <see cref="T:System.Type"/> to which the value of this instance is converted. 
	  ///                 </param><param name="provider">An <see cref="T:System.IFormatProvider"/> interface implementation that supplies culture-specific formatting information. 
	  ///                 </param><filterpriority>2</filterpriority>
	  public object ToType(Type conversionType, IFormatProvider provider)
	  {
	    throw new NotImplementedException();
	  }

	  #endregion
    //--------------------------------------------------------------------------
    protected object m_Value = null; // Value ot the item
    protected string m_Description = ""; // Description ot the item
    protected string m_ImageReference = null; // Reference to the related image
    protected string m_ColorReference = null; // Reference to the related color
    //--------------------------------------------------------------------------
    /// <summary>
    /// Constructor.
    /// </summary>
    /// <param name="value">value ot the item</param>
    /// <param name="description">description ot the item</param>
		public CxComboItem(object value, string description)
		{
      m_Value = value;
      m_Description = description;
		}
    //--------------------------------------------------------------------------
    /// <summary>
    /// Value ot the item.
    /// </summary>
    public object Value
    {
      get { return m_Value; }
    }
    //--------------------------------------------------------------------------
    /// <summary>
    /// Description ot the item.
    /// </summary>
    virtual public string Description
    {
      get { return m_Description; }
    }
    //--------------------------------------------------------------------------
    /// <summary>
    /// Reference to the image related to this item.
    /// </summary>
    virtual public string ImageReference
    {
      get { return m_ImageReference; }
      set { m_ImageReference = value; }
    }
    //--------------------------------------------------------------------------
    /// <summary>
    /// Reference to the color related to this item.
    /// </summary>
    virtual public string ColorReference
    {
      get { return m_ColorReference; }
      set { m_ColorReference = value; }
    }
    //--------------------------------------------------------------------------
    /// <summary>
    /// Returns string representation of the object.
    /// </summary>
    /// <returns>string representation of the object</returns>
    override public string ToString()
    {
      return Description;
    }
    //--------------------------------------------------------------------------
    /// <summary>
    /// Compares this object with another one.
    /// </summary>
    /// <param name="obj">object to compare with</param>
    /// <returns>1 if description of this objects is greater that one of the another object,
    /// 0 if they are equal or -1 otherwise</returns>
    public int CompareTo(object obj)
    {
      return Description.CompareTo(((CxComboItem) obj).Description);
    }
    //--------------------------------------------------------------------------
  }
}

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
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions