하나의 옛날 Interface에서 새로운 Interface로의 전환이 이루어지고, 지원되지 않는 interface가 존재하게 될때에.
public interface IEnumerationExam
{
bool HasMoreElements();
void NextElement();
}
public interface IIterator
{
bool HasNext();
void Next();
void Remove();
}
public class EnemurationIterator : IIterator
{
private IEnumerationExam iEnumerationExam;
#region IIterator Members
public bool HasNext()
{
return iEnumerationExam.HasMoreElements();
}
public void Next()
{
iEnumerationExam.NextElement();
}
public void Remove()
{
throw new NotSupportedException();
}
#endregion
}