using System;
using System.Collections;
namespace SecondSuite.Plugins
{
public class PluginCollection : CollectionBase
{
public PluginCollection()
{
}
public PluginCollection(PluginCollection value)
{
this.AddRange(value);
}
public PluginCollection(SSPlugin[] value)
{
this.AddRange(value);
}
public SSPlugin this[int index]
{
get {return ((SSPlugin)(this.List[index]));}
}
public int Add(SSPlugin value)
{
return this.List.Add(value);
}
public void AddRange(SSPlugin[] value)
{
for (int i = 0; (i < value.Length); i = (i + 1))
{
this.Add(value[i]);
}
}
public void AddRange(PluginCollection value)
{
for (int i = 0; (i < value.Count); i = (i + 1))
{
this.Add((SSPlugin)value.List[i]);
}
}
public bool Contains(SSPlugin value)
{
return this.List.Contains(value);
}
public void CopyTo(SSPlugin[] array, int index)
{
this.List.CopyTo(array, index);
}
public SSPlugin[] ToArray()
{
SSPlugin[] array = new SSPlugin[this.Count];
this.CopyTo(array, 0);
return array;
}
public int IndexOf(SSPlugin value)
{
return this.List.IndexOf(value);
}
public void Insert(int index, SSPlugin value)
{
List.Insert(index, value);
}
public void Remove(SSPlugin value)
{
List.Remove(value);
}
public new PluginCollectionEnumerator GetEnumerator()
{
return new PluginCollectionEnumerator(this);
}
public class PluginCollectionEnumerator : IEnumerator
{
private IEnumerator _enumerator;
private IEnumerable _temp;
///
/// Initializes a new instance of the PluginCollectionEnumerator class referencing the specified PluginCollection object.
///
/// The PluginCollection to enumerate.
public PluginCollectionEnumerator(PluginCollection mappings)
{
_temp = ((IEnumerable)(mappings));
_enumerator = _temp.GetEnumerator();
}
///
/// Gets the current element in the collection.
///
public SSPlugin Current
{
get {return ((SSPlugin)(_enumerator.Current));}
}
object IEnumerator.Current
{
get {return _enumerator.Current;}
}
///
/// Advances the enumerator to the next element of the collection.
///
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
public bool MoveNext()
{
return _enumerator.MoveNext();
}
bool IEnumerator.MoveNext()
{
return _enumerator.MoveNext();
}
///
/// Sets the enumerator to its initial position, which is before the first element in the collection.
///
public void Reset()
{
_enumerator.Reset();
}
void IEnumerator.Reset()
{
_enumerator.Reset();
}
}
}
}