I know this is simple problem but I am so new that there is some fundamental
disconnect in my understanding of: Enumerable, Enumerator, and Generics.
As a result I am having a problem debugging this error message
"Error 1 'SimpleSite.Email.Model.Hosts' does not implement interface member
'System.Collections.IEnumerable.GetEnumerator()'.
'SimpleSite.Email.Model.Hosts.GetEnumerator()' is either static, not public,
or has the wrong return type."
....in the following simple code...:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace SimpleSite.Email.Model
{
class Hosts : IEnumerable<Dictionary<String,Host>>
{
private Dictionary<String, Hosthosts;
Hosts()
{
hosts = new Dictionary<String, Host>();
}
public void Add(Host h)
{
if (hosts.Contains(h.getId()))
{
hosts.Remove(h.getId());
}
hosts.Add(h.getId(), h);
}
public IEnumerator<Dictionary<String,Host>GetEnumerator()
{
return (IEnumerator < Dictionary<String, Host)
this.hosts.GetEnumerator();
}
public Host Item(String key)
{
return hosts(key);
}
}
}
Any ideas why I am seeing this error and what I should change would be
greatly appreciated. Thanks!! - Richard
---------------
"Lisp doesn''t look any deader than usual to me."
- David Thornley, reply to a question older than most languages