Store Type in field/variable

Viewed 26424

How can I store a Type in a static field, so that I can do something like this (note: just an example, in pseudocode)?:

public class Logger
{
    public static Type Writer;

    public static void SetWriter(Type @new)
    {
        Writer = @new;
    }

    public static void Write(string str)
    {
        Writer.Write(str);
    }
}
3 Answers
Related