Hi,
I originally thought to make a static property, Item, and then use
whatever.Item( someName )
but the environment (it should be distribute to other developers) would
have been more "natural", more "cultural" using an indexer. I have to think
if there is not something along the lines you suggest, but my first
impression is that if I found back a "indexing" syntax, it may be with a
little extra complexity... and you know how developers are.... if they find
something is uselessly complex ... :-)
Vanderghast, Access MVP
"Patty O'Dors" <Pa********@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
Could you not have a helper class, and then declare a static variable of
the
type of this helper class in your main class, the helper class could then
implement the indexer itself (there would only be one instance of it).
"Michel Walsh" wrote:
Hi,
Looking for the syntax for a static indexer. For a non static
'access',
the following would do:
public class whatever
{
static Hashtable myHashtable = null;
// ----- here-----
public whatever this[string name]
{
get
{
return (whatever) myHashtable[name] ;
}
}
...
}
Clearly, that does not work prefixing with static,
static public whatever this[string name] {get{return (whatever)
myHashtable[name];} }
since 'this' cannot be used inside a static definition.
Vanderghast, Access MVP