You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
689 B
44 lines
689 B
using System;
|
|
using System.Collections;
|
|
|
|
namespace Org.BouncyCastle.Utilities.Collections
|
|
{
|
|
public sealed class EmptyEnumerable
|
|
: IEnumerable
|
|
{
|
|
public static readonly IEnumerable Instance = new EmptyEnumerable();
|
|
|
|
private EmptyEnumerable()
|
|
{
|
|
}
|
|
|
|
public IEnumerator GetEnumerator()
|
|
{
|
|
return EmptyEnumerator.Instance;
|
|
}
|
|
}
|
|
|
|
public sealed class EmptyEnumerator
|
|
: IEnumerator
|
|
{
|
|
public static readonly IEnumerator Instance = new EmptyEnumerator();
|
|
|
|
private EmptyEnumerator()
|
|
{
|
|
}
|
|
|
|
public bool MoveNext()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public void Reset()
|
|
{
|
|
}
|
|
|
|
public object Current
|
|
{
|
|
get { throw new InvalidOperationException("No elements"); }
|
|
}
|
|
}
|
|
}
|
|
|