Re: A job for reflection? Or is there a better way?
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 04/27/04
- Next message: cody: "Re: DTE get all using statement"
- Previous message: Jason Gleason: "# of occurences of string in another string"
- In reply to: Gary Morris: "Re: A job for reflection? Or is there a better way?"
- Next in thread: Gary Morris: "Re: A job for reflection? Or is there a better way?"
- Reply: Gary Morris: "Re: A job for reflection? Or is there a better way?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Apr 2004 21:50:11 +0100
Gary Morris <gwmorris1@hotpop.com> wrote:
> > I don't see why you actually *do* need to do that. There's no need to
> > have the actual *variable* with the same name.
>
> OK, I don't actually have to have THE node name, I just want some way
> of creating each instance of the tabpage with a unique name. Since I've
> never had the need to do anything like this, I am looking for any option.
Objects don't necessarily *have* names. Usually I find when people want
to give objects names, they're really after some way of retrieving an
object by a string key later on. That's where hashtables come in
useful.
> > I suggest you create the tab page and just put it in a Hashtable, using
> > the node name as the key.
>
> Never used a hashtable, though I've seen many programs and code
> snippets that do use them. Maybe it's time to look into it....???
That would be a good idea. I suggest you familiarize yourself with
ArrayLists as well Hashtables before going much further - they're both
pretty fundamental to writing many .NET applications. If you look up
"collection classes" in the MSDN index, you'll see there's a tutorial
and a couple of samples available. I haven't gone through them myself,
but reading them (and/or a Collections chapter in a .NET book) would be
a good idea.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: cody: "Re: DTE get all using statement"
- Previous message: Jason Gleason: "# of occurences of string in another string"
- In reply to: Gary Morris: "Re: A job for reflection? Or is there a better way?"
- Next in thread: Gary Morris: "Re: A job for reflection? Or is there a better way?"
- Reply: Gary Morris: "Re: A job for reflection? Or is there a better way?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|