public static void ConsolePrint(string text, bool BeforeLine = false, bool AfterLine = false) { if (LocalData.ProductionOrDevelopmentMode) { return; } if (BeforeLine) { BTodosJsInterop.Log(string.Empty); } BTodosJsInterop.Log(string.Empty); if (AfterLine) { BTodosJsInterop.Log(string.Empty); } }
public async static void CmdPrepare() { if (LocalData.IsDownloadedSetupData) { return; } if (LocalData.IsPreparingStarted) { return; } if (LocalData.TimezoneOffset == -99999) { LocalData.TimezoneOffset = await BTodosJsInterop.GetTimezoneOffset(); } //long milliseconds = await BTodosJsInterop.GetDateMilliseconds(); //.WriteLine(milliseconds); //DateTime d = new DateTime(1970,1,1).AddMilliseconds(milliseconds); //.WriteLine(d.ToString("MM/dd/yyyy HH:mm:ss.fff")); if (!LocalData.DesktopItemsList.Any()) { PrepareDesktop(); } LocalData.WindowSize.W = (int)(await BTodosJsInterop.GetWindowWidth()); LocalData.WindowSize.H = (int)(await BTodosJsInterop.GetWindowHeight()); if (string.IsNullOrEmpty(LocalData.MachineID)) { LocalData.MachineID = await BTodosJsInterop.GetMachineID(); } LocalData.IsPreparingStarted = true; if (!LocalData.IsDownloadedSetupData) { bool b = await WebApi.Cmd_Get_PublicData(); if (b) { LocalData.CurrJWT = string.Empty; b = await WebApi.CmdGetJWT(LocalData.ServerNotAuthorizedUserName, LocalData.ServerNotAuthorizedUserPass, WebApiUserTypesEnum.NotAuthorized); LocalData.IsReady = b; if (LocalData.UsingUITranslator) { await GetUILanguages(); } LocalData.compFooter.Refresh(); if (b) { timerHelper.OnTick = TimerTick; if (LocalData.WebOrLocalMode) { timerHelper.Start(1, 10000); } else { timerHelper.Start(1, 10000 * 60); } } } else { LocalData.IsReady = false; } } LocalData.IsPreparingStarted = false; }