Stephen,
Have you tried something like (tested in VS.NET 2003):
delegate void Foo1Delegate(int i);
delegate void Foo2Delegate(char ch);
delegate void Foo3Delegate(string s);
static void Main()
{
Hashtable dels = new Hashtable();
dels.Add( "key1", new Foo1Delegate(MyFoo1) );
dels.Add( "key2", new Foo2Delegate(MyFoo2) );
dels.Add( "key3", new Foo3Delegate(MyFoo3) );
object o = dels["key2"];
if (o is Foo1Delegate)
{
Foo1Delegate d = (Foo1Delegate)o;
d(1);
}
else if (o is Foo2Delegate)
{
Foo2Delegate d = (Foo2Delegate)o;
d(' ');
}
else if (o is Foo3Delegate)
{
Foo3Delegate d = (Foo3Delegate)o;
d("");
}
}
static void MyFoo1(int i)
{
}
static void MyFoo2(char ch)
{
}
static void MyFoo3(string s)
{
}
Hope this helps
Jay
"Stephen Johns" <bl*********@yahoo.com> wrote in message
news:en****************@TK2MSFTNGP10.phx.gbl...
Thanks for the info guys! That is what I am looking for.
I guess I am just old school, "typesafeness" hmmmm... sounds like
training wheels... Give me a (void *) anyday, I'll remember what I put
in there I'd never accidentally try and "call" a piece of data! hahahaha
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!