How do you define a getter and setter for complex data types such as a dictionary?
public Dictionary<string, string> Users
{
get
{
return m_Users;
}
set
{
m_Users = value;
}
}
This returns the entire dictionary? Can you write the setter to look and see if a specific key-value pair exists and then if it doesn't, add it. Else update the current key value pair? For the get, can you return a specific key-value pair instead of the whole dictionary?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…