public static void Run() { Bderived b = new Bderived(); ABase a = b; Iinterface i = b; a.hello(); b.hello(); i.hello(); }
override public IProcessor Create(ABase a) { // this is ugly for a large amount of ABase implementations of course if (a is A1) { return(new Runtime1()); } if (a is A2) { return(new Runtime2()); } throw new NotSupportedException(); }
public void AddAnswerToAnAnswerSheet() { AnswerSheet s = SetupSheet(); QBinary q = s.Form.Questions.AddANewQuestion <QBinary>("Est-ce que c'est bon ?", true); ABase a = s.CreateAnswerFor(q); Assert.IsNotNull(a); Assert.IsInstanceOf(typeof(ABinary), a); ABinary b = (ABinary)a; b.Answer = true; }
public void Valid(ABase answer) { Console.WriteLine("I'm BASE"); }
public abstract IProcessor Create(ABase a);
public void ProcessA(ABase a) { // process away differently }
public void ProcessA(ABase a) { // process away }