Exemplo n.º 1
0
    public AppropriateReturnType process(ConditionalThing state)
    {
        Func<AppropriateReturnType> f = registry[state];
        AppropriateReturnType result = f();

        return result.process(state);
    }
Exemplo n.º 2
0
    public static AppropriateReturnType process(ConditionalThing state)
    {
        AppropriateReturnType result;

        switch (state) {
            case ConditionalThing.State_A:
                result = new ReturnTypeA();
                break;
            case ConditionalThing.State_B:
                result = new ReturnTypeB();
                break;
            default:
                result = new ReturnTypeC();
                break;
        };
        return result.process(state);
    }
Exemplo n.º 3
0
 public AppropriateReturnType process(ConditionalThing state)
 {
     Console.WriteLine("TRACER A");
     return this;
 }
Exemplo n.º 4
0
 public static AppropriateReturnType process(ConditionalThing state)
 {
     return factory.process(state);
 }