Exemplo n.º 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            SimulatorManager simulatorManager = new SimulatorManager();
        }
Exemplo n.º 2
0
        //private int PinAttempts { get; set; }

        public Simulator(SimulatorManager manager, string instanceName)
        {
            //this.Master = master;
            this.InstanceName = instanceName;
            this.Manager      = manager;

            this.Screen = new Forms.Screen();
            //this.Screen.MdiParent = master;
            this.Screen.StartPosition = FormStartPosition.CenterScreen;
            this.Screen.Text          = string.Format(this.Screen.Text + " [{0}]", this.InstanceName);
            this.Screen.Location      = new System.Drawing.Point(this.Screen.Location.X, this.Screen.Location.Y - this.Screen.Height / 2 + 10);
            this.Screen.Size          = new System.Drawing.Size(388, 320);

            this.PinEntry = new Forms.PinEntry();
            //this.PinEntry.MdiParent = master;
            this.PinEntry.StartPosition = FormStartPosition.CenterScreen;
            this.PinEntry.Text          = string.Format(this.PinEntry.Text);
            this.PinEntry.Location      = new System.Drawing.Point(this.PinEntry.Location.X, this.PinEntry.Location.Y + this.PinEntry.Height / 2 + 10);
            this.PinEntry.Size          = new System.Drawing.Size(300, 321);

            this.Screen.Move   += Screen_Move;
            this.PinEntry.Move += PinEntry_Move;

            this.PinEntry.btnOne.Click     += btnOne_Click;
            this.PinEntry.btnTwo.Click     += btnTwo_Click;
            this.PinEntry.btnThree.Click   += btnThree_Click;
            this.PinEntry.btnFour.Click    += btnFour_Click;
            this.PinEntry.btnFive.Click    += btnFive_Click;
            this.PinEntry.btnSix.Click     += btnSix_Click;
            this.PinEntry.btnSeven.Click   += btnSeven_Click;
            this.PinEntry.btnEight.Click   += btnEight_Click;
            this.PinEntry.btnNine.Click    += btnNine_Click;
            this.PinEntry.btnZero.Click    += btnZero_Click;
            this.PinEntry.btnDecimal.Click += btnDecimal_Click;
            this.PinEntry.btnCancel.Click  += btnCancel_Click;
            this.PinEntry.btnClear.Click   += btnClear_Click;
            this.PinEntry.btnEnter.Click   += btnEnter_Click;

            DepositWorker         = new BackgroundWorker();
            DepositWorker.DoWork += DepositWorker_DoWork;

            WithdrawWorker         = new BackgroundWorker();
            WithdrawWorker.DoWork += WithdrawWorker_DoWork;
        }