I swear I have seen an example of this but have been googling for a bit and can not find it.
I have a class that has a reference to an object and need to have a GET; met
i agree with ReadOnlyCollection
See my simple code:
private List _devices;
public readonly System.Collections.ObjectModel.ReadOnlyCollection Devices
{
get
{
return (_devices.AsReadOnly());
}
}
ReadOnlyCollection dosen't has Add method so user cant add properties to it.BUT ther is no warranty that if user can modify objects by calling their methods....