|
/* *******************************************************
* This code created and or modified by Chris Lasater
* http://www.geocities.com/lasaterconsult
* Please refer all questions or comments to chris.lasater@gmail.com
*
* You can use this code however you like, but please, make sure you give me
* credit on any publishings you do from this code.
*
* No warrenty is implied for any code here.
*
* *******************************************************
*/
using System;
using System.Collections;
namespace Properties.Entity
{
/// <summary>
/// Summary description for EntityAttributeCollection.
/// </summary>
public class EntityAttributeCollection
{
private ArrayList _list = new ArrayList();
/// Get the item in the list at position [index]
/// </summary>
public EntityAttribute this[int index]
{
get
{
return (EntityAttribute) _list[index];
}
set
{
_list[index] = (EntityAttribute) value;
}
}
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
internal void Add( EntityAttribute obj )
{
if(!_list.Contains(obj))
_list.Add( obj );
}
/// <summary>
/// Remove an EntityAttribute object from the collection
/// </summary>
/// <param name="value"></param>
internal void Remove( string key )
{
_list.Remove( key );
}
/// <summary>
/// Determines if an EntityAttribute object exists in the collection
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool Contains( EntityAttribute obj )
{
// If value is not of type EntityAttribute, this will return false.
return( _list.Contains( obj ) );
}
/// <summary>
/// Determines if the current EntityAttributeCollection and the EntityAttributeCollection passed in are the same list
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public bool Equals(EntityAttributeCollection obj)
{
return _list.Equals (obj);
}
/// <summary>
/// Get the HashCode for the EntityAttributeCollection
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
return _list.GetHashCode();
}
/// <summary>
///
/// </summary>
public void Clear()
{
_list.Clear();
}
/// <summary>
/// Returns the enumerator object for the list
/// </summary>
/// <returns></returns>
public IEnumerator GetEnumerator()
{
return _list.GetEnumerator();
}
}
}
|
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.