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

Web User Forms for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.90/5 (52 votes)
18 Sep 2012CPOL12 min read 135.2K   4.5K   187  
User driven runtime dynamic ASP.NET Web Forms
// -- FILE ------------------------------------------------------------------
// name       : IFormEntityCollection.cs
// project    : Itenso Web User Forms
// created    : Jani Giannoudis - 2008.10.30
// language   : c#
// environment: .NET 2.0
// copyright  : (c) 2008-2012 by Itenso GmbH, Switzerland
// --------------------------------------------------------------------------
using System.Collections.Generic;

namespace Itenso.WebUserForms.Data.Form
{

	// ------------------------------------------------------------------------
	public interface IFormEntityCollection : IEnumerable<IFormEntity>
	{

		// ----------------------------------------------------------------------
		/// <summary>
		/// Access to the number of items.
		/// </summary>
		/// <value>the number of items in the collection</value>
		int Count { get; }

		// ----------------------------------------------------------------------
		/// <summary>
		/// Index access to the items of this collection.
		/// </summary>
		/// <param name="index">the index of the item to retrieve</param>
		/// <returns>the item at the given position</returns>
		IFormEntity this[ int index ] { get; }

		// ----------------------------------------------------------------------
		/// <summary>
		/// Provides the index of an element in this collection.
		/// </summary>
		/// <param name="item">The element whose index is to be returned.</param>
		/// <returns>The index of an element in this collection, or -1 if the element does not exist.</returns>
		int IndexOf( IFormEntity item );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Copies this collections items to the given array.
		/// </summary>
		/// <param name="array">the target array</param>
		/// <param name="index">the target index</param>
		void CopyTo( IFormEntity[] array, int index );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Adds the given item.
		/// </summary>
		/// <param name="item">the item to add</param>
		/// <returns>the insertion position</returns>
		int Add( IFormEntity item );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Adds the given item at the given position.
		/// </summary>
		/// <param name="item">the item to add</param>
		/// <param name="pos">the position to insert the new item into</param>
		void Add( IFormEntity item, int pos );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Adds all items in the given list to this instance.
		/// </summary>
		/// <param name="items">the items to add</param>
		void AddAll( IEnumerable<IFormEntity> items );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Removes the given item.
		/// </summary>
		/// <param name="item">the item to remove</param>
		void Remove( IFormEntity item );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Removes the item at the given position.
		/// </summary>
		/// <param name="index">the index of the item to remove</param>
		void RemoveAt( int index );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Removes all entries from this instance.
		/// </summary>
		void Clear();

		// ----------------------------------------------------------------------
		/// <summary>
		/// Provides convenience search access to an individual item of this instance.
		/// </summary>
		/// <param name="itemName">the name of the item to find</param>
		/// <returns>the item within this instance with the given name or null if
		/// no such item could be found</returns>
		IFormEntity FindByItemName( string itemName );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Provides convenience search access to an individual field of this instance.
		/// </summary>
		/// <param name="fieldName">the name of the field to find</param>
		/// <returns>the field within this instance with the given name or null if
		/// no such field could be found or if the found item with the given name is
		/// not a field (but rather a form)</returns>
		IFormField FindFieldByName( string fieldName );

		// ----------------------------------------------------------------------
		/// <summary>
		/// Provides convenience search access to an individual form of this instance.
		/// </summary>
		/// <param name="formName">the name of the form to find</param>
		/// <returns>the form within this instance with the given name or null if
		/// no such form could be found or if the found item with the given name is
		/// not a form (but rather a field)</returns>
		IForm FindFormByName( string formName );

	} // interface IFormEntityCollection

} // namespace Itenso.WebUserForms.Data.Form
// -- EOF -------------------------------------------------------------------

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)
Switzerland Switzerland
👨 Senior .NET Software Engineer

🚀 My Open Source Projects
- Time Period Library 👉 GitHub
- Payroll Engine 👉 GitHub

Feedback and contributions are welcome.



Comments and Discussions