Click here to Skip to main content
15,921,990 members
Home / Discussions / C#
   

C#

 
QuestionWaitOne won't wakeup Pin
doubleclick2d20-Apr-10 14:58
doubleclick2d20-Apr-10 14:58 
AnswerRe: WaitOne won't wakeup Pin
Luc Pattyn20-Apr-10 15:41
sitebuilderLuc Pattyn20-Apr-10 15:41 
Questionunresolved hashtable problem [modified] Pin
Jassim Rahma20-Apr-10 12:55
Jassim Rahma20-Apr-10 12:55 
AnswerRe: unresolved hashtable problem Pin
Luc Pattyn20-Apr-10 14:10
sitebuilderLuc Pattyn20-Apr-10 14:10 
AnswerRe: unresolved hashtable problem Pin
Som Shekhar20-Apr-10 18:18
Som Shekhar20-Apr-10 18:18 
GeneralRe: unresolved hashtable problem Pin
Jassim Rahma24-Apr-10 23:48
Jassim Rahma24-Apr-10 23:48 
GeneralRe: unresolved hashtable problem Pin
Som Shekhar24-Apr-10 23:56
Som Shekhar24-Apr-10 23:56 
GeneralRe: unresolved hashtable problem Pin
Jassim Rahma25-Apr-10 0:06
Jassim Rahma25-Apr-10 0:06 
GeneralRe: unresolved hashtable problem Pin
Som Shekhar25-Apr-10 0:17
Som Shekhar25-Apr-10 0:17 
GeneralRe: unresolved hashtable problem Pin
Jassim Rahma25-Apr-10 0:23
Jassim Rahma25-Apr-10 0:23 
GeneralRe: unresolved hashtable problem Pin
Som Shekhar25-Apr-10 0:33
Som Shekhar25-Apr-10 0:33 
GeneralRe: unresolved hashtable problem Pin
Jassim Rahma25-Apr-10 1:14
Jassim Rahma25-Apr-10 1:14 
GeneralRe: unresolved hashtable problem Pin
Som Shekhar25-Apr-10 1:25
Som Shekhar25-Apr-10 1:25 
GeneralRe: unresolved hashtable problem [modified] Pin
Jassim Rahma26-Apr-10 3:48
Jassim Rahma26-Apr-10 3:48 
GeneralRe: unresolved hashtable problem Pin
Som Shekhar26-Apr-10 3:54
Som Shekhar26-Apr-10 3:54 
GeneralRe: unresolved hashtable problem Pin
Jassim Rahma26-Apr-10 12:35
Jassim Rahma26-Apr-10 12:35 
GeneralRe: unresolved hashtable problem Pin
Som Shekhar26-Apr-10 17:41
Som Shekhar26-Apr-10 17:41 
QuestionVariable of type Pin
jabbawok20-Apr-10 10:18
jabbawok20-Apr-10 10:18 
How do you store a type in a variable?

Let's say I have the following base class, and a couple of derived classes:

public abstract class MyBase
{
    public abstract string Test();

}

public class class1: MyBase
{
    public override string Test()
    {
        return "Class1";
    }
}

public class class2 : MyBase
{
    public override string Test()
    {
        return "Class2";
    }
}

Now, I want to store the "types" of class1 and class2 in an array, so I can instance the classes, something like this:

MyArray[0] TmpClass1 = new MyArray[0];
MyArray[1] TmpClass2 = new MyArray[1];

Obviously this doesn't work. And I've tried using typeof() and System.Type to do this, but end up getting compiler errors no matter what I try.

So how is it done?
AnswerRe: Variable of type Pin
Anthony Mushrow20-Apr-10 10:31
professionalAnthony Mushrow20-Apr-10 10:31 
GeneralRe: Variable of type Pin
jabbawok20-Apr-10 10:37
jabbawok20-Apr-10 10:37 
AnswerRe: Variable of type Pin
Luc Pattyn20-Apr-10 10:34
sitebuilderLuc Pattyn20-Apr-10 10:34 
GeneralRe: Variable of type Pin
jabbawok20-Apr-10 10:54
jabbawok20-Apr-10 10:54 
GeneralRe: Variable of type Pin
jabbawok20-Apr-10 11:00
jabbawok20-Apr-10 11:00 
GeneralRe: Variable of type Pin
Luc Pattyn20-Apr-10 11:09
sitebuilderLuc Pattyn20-Apr-10 11:09 
GeneralRe: Variable of type Pin
jabbawok20-Apr-10 12:53
jabbawok20-Apr-10 12:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.