Пример #1
0
        protected override /*async*/ void OnStartup(StartupEventArgs e)
        {
            Bpr.BeepShort();

            Current.DispatcherUnhandledException += UnhandledExceptionHndlr.OnCurrentDispatcherUnhandledException;

            Tracer.SetupTracingOptions("TypingWpf", AppTraceLevel_Warnng);

            base.OnStartup(e);

#if _DEBUG
            await sw();

            //MainVM.UpdateDoneTodo("Zoe", null);
            //DeadlockDemo.NoDeadlock();
            //DeadlockDemo.Causes_A_Deadlock();

            //Trace.WriteLine(LessonHelper.GetLesson(LessonType.Combinations, 1));
            //LessonHelper.CodeGen();
            //new xChartPoc().ShowDialog();
            //IsoHelper.ListIsoFolders(); return;
            //new Vws.DbExplorer2().ShowDialog(); // new JsonToSqlMigrator().ShowDialog();
#else
            var mw = new MainWindow();
            var vm = MainVM.Create(mw.cChart1);
            if (vm != null)
            {
                BindableBaseViewModel.ShowModalMvvmAsync(vm, mw);
            }
            else
#endif
            Shutdown();
        }
Пример #2
0
        public static A0DbMdl GetMigrate([CallerMemberName] string cmn = "", [CallerFilePath] string cfp = "", [CallerLineNumber] int cln = 0)
        {
            var sw = Stopwatch.StartNew();

            //Trace.WriteLine($"{DateTime.Now:HH:mm:ss.fff} GetCreateA0DbMdl: called from {cfp}({cln}):\t{cmn}()");

            Bpr.BeepShort();
            var db = GetA0DbMdlAzureDb;

            Trace.WriteLine($"{DateTime.Now:HH:mm:ss.fff}   took {sw.ElapsedMilliseconds:N0} ms."); sw.Restart();
            if (db.Database.Exists())
            {
#if !NeedToWaitFor_4sec
                if (!db.Database.CompatibleWithModel(false))
                {
                    DbInitializer.SetMigraInitializer();
                }
#endif
            }
            else
            {
                DbInitializer.SetDbInitializer();
            }

            Trace.WriteLine($"{DateTime.Now:HH:mm:ss.fff}   took {sw.ElapsedMilliseconds:N0} ms.");
            return(db);
        }
Пример #3
0
        async void onLoaded(object s, RoutedEventArgs e)
        {
            _db = A0DbContext.Create();
            await Task.Yield();                   // displays window now - not after db loads.

            await _db.Vw_TxCore.LoadAsync();      // TxCoreV2 would show the MoneySrc.Name in Binding

            await _db.Vw_Exp_Hist_vs_Last.LoadAsync();

            dgTxVs.ItemsSource = _db.Vw_Exp_Hist_vs_Last.Local.OrderBy(r => r.Name).ThenBy(r => r.TaxLiq__);
            dgTxVs.Focus();
            Bpr.BeepShort();
        }
Пример #4
0
        public static A0DbMdl GetInitDbx([CallerMemberName] string cmn = "", [CallerFilePath] string cfp = "", [CallerLineNumber] int cln = 0)
        {
            Bpr.BeepShort();

            var sw = Stopwatch.StartNew();
            var db = GetA0DbMdlAzureDb;

            Trace.WriteLine($"{DateTime.Now:HH:mm:ss.fff}   took {sw.ElapsedMilliseconds:N0} ms."); sw.Restart();

            if (!db.Database.Exists())
            {
                DbInitializer.SetDbInitializer();
            }

            Trace.WriteLine($"{DateTime.Now:HH:mm:ss.fff}   took {sw.ElapsedMilliseconds:N0} ms.");

            return(db);
        }
Пример #5
0
        void setAnglesToNowTime(DateTime now)
        {
            S60 = 354 + (S_1 = 6 + (S_0 = /*HandSecAngle.Angle =*/ (now.Second * 6)));
            HandMinAngle.Angle = (now.Minute * 6 + now.Second * .1);
            HandHouAngle.Angle = ((now.Hour - 12) * 30 + now.Minute * .5);

            if (now.Minute % 4 == 0) // (now < App.StartedAt.AddMinutes(2))
            {
                HandSec.BeginStoryboard(sbMoveSecondHandAnlg);
            }
            else
            {
                HandSec.BeginStoryboard(sbMoveSecondHandImdt);
            }

            CurentMM = now.Minute;
            CurntMin = now.Minute * 6 + now.Second * .1 + .1;
            CurntHou = now.TimeOfDay.TotalDays * 720;

#if DEBUG
            Bpr.BeepShort();
#endif
        }