You can use a wrapper around a List to get the "Items" property.
public class MyClass
{
private readonly List<string> _myColl = new List<string>();
public List<string> Items
{
get { return this._myColl; }
}
}
You can then use it like so:
MyClass c = new MyClass();
c.Items.Add("something");
If you need a string key, you can always switch List to Dictionary<string, string>
public class MyClass
{
private readonly Dictionary<string, string> _myColl = new Dictionary<string, string>();
public Dictionary<string, string> Items
{
get { return this._myColl; }
}
}
Then use it like so:
MyClass c = new MyClass();
c.Items.Add("somekey", "somevalue");
I guess the point is that you can wrap just about any collection with this pattern to fit almost any need.