Exemplo n.º 1
0
        public PodCatcherViewModel(bool countDown = true)
        {
            Bpr.Beep1of2();

            CurVer = VerHelper.CurVerStr(A0DbContext.SqlEnv); //bool isDay0; if (bool.TryParse(MiscDataHelper.GetSetting("daq", "IsDay0", "True", "Directive flag to run all tasks in Full or Daily/Delta mode.").SValue, out isDay0))IsDay0 = isDay0;

            IsAutoNextStep = countDown;

            Task.Run(() => Thread.Sleep(1))
            .ContinueWith(async _ => await reLoad(), TaskScheduler.FromCurrentSynchronizationContext())
            .ContinueWith(_ =>
            {
#if !SkipCountDown
                if (IsAutoNextStep)
                {
                    Bpr.BeepOkB();
                }
                Thread.Sleep(1000);
                if (IsAutoNextStep)
                {
                    Bpr.BeepFD(9000, 200);
                }
                Thread.Sleep(1000);
                if (IsAutoNextStep)
                {
                    Bpr.BeepFD(8600, 200);
                }
                Thread.Sleep(1000);
                if (IsAutoNextStep)
                {
                    Bpr.BeepFD(8300, 200);
                }
                Thread.Sleep(1000);
                if (IsAutoNextStep)
                {
                    Bpr.BeepFD(8000, 600);
                }
                Thread.Sleep(1000);
                if (IsAutoNextStep)
                {
                    Bpr.BeepFD(7000, 200);
                }
                Thread.Sleep(5);
                if (IsAutoNextStep)
                {
                    Bpr.BeepFD(7000, 200);
                }
#endif
            })
            .ContinueWith(_ => { if (IsAutoNextStep)
                                 {
                                     onDoAll(null);
                                 }
                          }, TaskScheduler.FromCurrentSynchronizationContext())
            .ContinueWith(_ => Bpr.Beep2of2(), TaskScheduler.FromCurrentSynchronizationContext());
        }