コード例 #1
0
        static void Main(string[] args)
        {
            Program program = new Program();

            gate = new GateExample.Gate();


            Console.WriteLine(@"Select one of the following option:                                
                            1-Enter
                            2-Pay
                            3-PayOk
                            4-PayFailed
                            5-Get Current State
                            6-Help
                            7-exit");

            string key;

            while ((key = Console.ReadKey().KeyChar.ToString()) != "7")
            {
                Console.WriteLine();
                int keyValue;
                int.TryParse(key, out keyValue);

                ProcessInput(keyValue);
            }
        }
コード例 #2
0
 public ProcessingGateState(Gate gate) : base(gate)
 {
     this.gate = gate;
 }
コード例 #3
0
 public ClosedGateState(Gate gate) : base(gate)
 {
     this.gate = gate;
 }
コード例 #4
0
 public OpenGateState(Gate gate) : base(gate)
 {
     this.gate = gate;
 }
コード例 #5
0
 public GateState(Gate gate)
 {
     Console.WriteLine("Creating New State : " + this.GetType().ToString());
     this.gate = gate;
 }