Ejemplo n.º 1
0
        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
            if (Timer != null)
            {
                if (Timer.IsTimerWorking == false && CanTimerStart)
                {
                    Timer.Start();

                    CanTimerStart = false;
                    scramble1     = new Scramble();
                    scramble.Text = scramble1.ToString();
                    ScrambleShow(scramble1);
                    return;
                }
            }
            if (stoped == true)
            {
                textblock1.Text       = Time.History[Time.History.Count - 1].ToString();
                textblock1.Visibility = Visibility.Visible;
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Scramble scramble = new Scramble();

            Console.WriteLine(scramble.ToString());
            //Timer = new CubingTimer(new User(1, "name", "lname")); // TODO: Fix to the current user
            Timer.LoadScramble(scramble);
            Timer.Started        += Timer_Started;
            Handlers.TimeChanged += CurrentTime_TimeChanged;
            Timer.TimerStoped    += Timer_TimerStoped;
            newThread             = new Thread(ThreadVoid);

            for (Int32 i = 3; i > 0; i--)
            {
                Console.WriteLine($"Timer starts in {i} sec");
                Thread.Sleep(1000);
            }
            Console.WriteLine("P.S. Pls, write something to stop timer!");
            Timer.Start();
            newThread.Start();
        }