public class Person : ICloneable
{
private string name;
private int age;
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
public int Age
{
get
{
return age;
}
set
{
age = value;
}
}
class Persons : DictionaryBase
{
public void Add(string myKey, Person myPerson)
{
Dictionary.Add(myKey, myPerson);
}
public void Remove(string myKey)
{
Dictionary.Remove(myKey);
}
public Persons()
{
}
public Person this[string myKey]
{
get
{
return (Person)Dictionary[myKey];
}
set
{
Dictionary[myKey] = (Person)value;
}
}
}
[此贴子已经被作者于2006-12-21 3:25:51编辑过]