Пример #1
0
        public void RedrawPrime(bool nead_to_delay)
        {
            if (!can_redraw_prime)
            {
                return;
            }

            can_redraw_prime = false;

            if (prime_chart == null)
            {
                can_redraw_prime = true;
                return;
            }

            prime_chart.Calculate(owner.time_frame_span, owner.time_frame);
            prime_chart.Redraw();

            if (nead_to_delay)
            {
                delay = new Task(() =>
                {
                    Delay(25).Wait(50);
                });

                delay.Start();
                delay.Wait(100);
            }

            can_redraw_prime = true;
        }
Пример #2
0
        public void RedrawPrime(bool nead_to_delay)
        {
            if (!can_redraw_prime) //если процесс сломался по exception, то никогда не будет новой перерисовки
            {
                return;
            }

            can_redraw_prime = false;

            if (prime_chart == null)
            {
                can_redraw_prime = true;
                return;
            }

            try
            {
                prime_chart.Calculate(owner.time_frame_span, owner.time_frame);
                prime_chart.Redraw();
            }
            catch
            {
                can_redraw_prime = true;  // попробуем так
            }


            if (nead_to_delay)
            {
                delay = new Task(() =>
                {
                    Delay(25).Wait(50);
                });

                delay.Start();
                delay.Wait(100);
            }

            can_redraw_prime = true;
        }