using System;
using Microsoft.SPOT;
using System.Collections;
namespace IndianaJones.NETMF.Arrays
{
///
/// Extension methods for ArrayList
///
public static class ArrayListExtensions
{
///
/// Add Range to ArrayList
///
/// Aray List to add to
/// Items to be added to the collection
public static void AddRange(this ArrayList list, Array arr)
{
foreach (object b in arr)
{
list.Add(b);
}
}
// Add a range of the source collection to the destination collection
public static void AddRange(this ArrayList list, ArrayList arr, int sourceIndex, int length)
{
for (int i = sourceIndex; i < length; i++)
{
list.Add(arr[i]);
}
}
///
/// Removes a range of elements from the ArrayList
///
/// List to operate on
/// starting index
///
public static void RemoveRange(this ArrayList list, int index, int count)
{
for (int i = 0; i < count; i++)
{
list.RemoveAt(index);
}
}
}
}