How to avoid type checking in C# to load correct UI?
问题 I am building a simple quiz program with WinForms that has 2 modes: 1) Edit mode: Where the user can create its own questions 2) Quiz mode: Where the user needs to answer the questions Currently there are 2 type of questions: Open (question and free text box) and multiple choice (question and 4 possible answers). I have created an abstract class for a Question: public abstract class Question { public string QuestionString { get; private set; } public Question(string q) { QuestionString = q; }