G
Guest
I have a standard CollectionBase implementation called UnitCollection. And
yes, the collection items are class Unit ;-)
Code:
public class Row
{
public Row()
{ ... }
public UnitCollection Units
{
get
{
...
}
}
}
Problem occurs when I try to do this:
Row row = new Row();
row.Units.Add(new Unit());
foreach(Unit u in row.Units)
{
...
}
The UnitCollection (Units) has no items... I'm wondering whether it has
something to do with the fact that Units is a readonly property of class Row?
Stupid question, I guess, but I don't know what to do...
Hope I've made an understandable point. And that someone can help, naturally!
yes, the collection items are class Unit ;-)
Code:
public class Row
{
public Row()
{ ... }
public UnitCollection Units
{
get
{
...
}
}
}
Problem occurs when I try to do this:
Row row = new Row();
row.Units.Add(new Unit());
foreach(Unit u in row.Units)
{
...
}
The UnitCollection (Units) has no items... I'm wondering whether it has
something to do with the fact that Units is a readonly property of class Row?
Stupid question, I guess, but I don't know what to do...
Hope I've made an understandable point. And that someone can help, naturally!