phoenix,
In this case, you have to expose the Hashtable itself, so you would do
this:
public Hashtable size
{
get
{
return b;
}
}
Of course, that leaves your hashtable open to modification, so you might
not want to do that. In that case, you will want to create your own read
only dictionary that does not allow the setting of the values outside of
your code.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"phoenix" <pa******@skynetWORK.be> wrote in message
news:ee*************@TK2MSFTNGP12.phx.gbl...
Hello,
I have the following class :
public class Unit {
Hashtable a;
Hashtable b;
// constructors
public object this[string name]
{
get
{
return a[name];
}
}
}
Which works like a charm, but now i want a second property say size on
which i can use an indexer as well. So something like this
public object size[string name]
{
get
{
return b[name];
}
}
but i don't find a way to get it working. Any ideas ?
TIA
Yves