public async void loadFileRegular() { log.Clear(); if (await LBDJsInterop.HasFile("fileUpload")) { await CounterHelper.CmdAddCounter(new TSCounter() { Source = navigationManager.Uri, Action = "ClickButtonRegular" }); BlazorTimeAnalyzer.Reset("Regular mode"); log.Add("started"); log.Add("js is loading file..."); StateHasChanged(); BlazorTimeAnalyzer.Add("set data", MethodBase.GetCurrentMethod()); string a = await LBDJsInterop.GetFile(_BinaryInfo.variableName, "fileUpload"); log.Add(a); log.Add(".net loaded " + a.Length + " bytes"); log.Add("done"); BlazorTimeAnalyzer.LogAll(); StateHasChanged(); } else { await LBDJsInterop.Alert("Please select file"); } }
private void _BinaryInfo_OnFinish() { _BinaryInfo.progressInfo = "done"; log.Add(".net loaded " + _BinaryInfo.dataLenght + " bytes"); log.Add("done"); BlazorTimeAnalyzer.LogAll(); StateHasChanged(); }
//protected override void OnInitialized() //{ // base.OnInitialized(); //} public async void JsSendMessage() { if (!string.IsNullOrEmpty(JsMessage)) { await CounterHelper.CmdAddCounter(new TSCounter() { Source = navigationManager.Uri, Action = "ClickButtonRegular" }); ExpandData(); log.Add(JsMessage); BlazorTimeAnalyzer.Reset(); BlazorTimeAnalyzer.Add("set data", MethodBase.GetCurrentMethod()); await LBDJsInterop.SetData("myTmpVar1", JsMessage); BlazorTimeAnalyzer.Add("process data", MethodBase.GetCurrentMethod()); LBDJsInterop.ProcessData("myTmpVar1"); BlazorTimeAnalyzer.Add("get data", MethodBase.GetCurrentMethod()); log.Add(await LBDJsInterop.GetData("myTmpVar1")); BlazorTimeAnalyzer.LogAll(); JsMessage = string.Empty; } else { await LBDJsInterop.Alert("Please input message"); } StateHasChanged(); }
public async static void Authorize(string ParUserName, string ParPassword) { LocalData.CurrJWT = string.Empty; BlazorTimeAnalyzer.DevelopmentMode = !LocalData.ProductionOrDevelopmentMode; BlazorTimeAnalyzer.Reset(); BlazorTimeAnalyzer.LogAllAddition = true; BlazorTimeAnalyzer.Add("A1", MethodBase.GetCurrentMethod()); timerHelper.Stop(); if (await WebApi.CmdGetJWT(GlobalFunctions.ConvertToSecureString(ParUserName), GlobalFunctions.ConvertToSecureString(ParPassword), WebApiUserTypesEnum.Authorized)) { BlazorTimeAnalyzer.Add("A2", MethodBase.GetCurrentMethod()); TSUser tmpTSUser = new TSUser { UserName = ParUserName, Password = ParPassword, }; BlazorTimeAnalyzer.Add("A2", MethodBase.GetCurrentMethod()); LocalData.CurrTSUser = await WebApiFunctions.CmdTSUserAuthorize(tmpTSUser); BlazorTimeAnalyzer.Add("A3", MethodBase.GetCurrentMethod()); if (LocalData.CurrTSUser.UserName.ToLower().Equals("error!")) { LocalData.AppHasGlobalError = true; AddError(LocalData.CurrTSUser.FullName, MethodBase.GetCurrentMethod(), true, false); } else { LocalData.IsAuthenticated = !LocalData.CurrTSUser.ID.Equals(Guid.Empty); if (LocalData.IsAuthenticated) { timerHelper.OnTick = TimerTick; timerHelper.Start(1, 10000); BlazorTimeAnalyzer.Add("A4", MethodBase.GetCurrentMethod()); await WebApiFunctions.CmdGetFeedback(); BlazorTimeAnalyzer.Add("A5", MethodBase.GetCurrentMethod()); await WebApiFunctions.CmdGetReaction(); BlazorTimeAnalyzer.Add("A6", MethodBase.GetCurrentMethod()); LocalData.LoginLogout = LocalData.CurrTSUser.UserName; LocalData.btModal.Close(); CmdNavigate("DesktopPage"); LocalData.EventConsumerName = "TodosPage"; LocalData.componentBridge.InvokeRefresh(); LocalData.compHeader.Refresh(); LocalData.AppHasGlobalError = false; BlazorTimeAnalyzer.Add("A7", MethodBase.GetCurrentMethod()); } else { bool b = await WebApi.CmdGetJWT(LocalData.ServerNotAuthorizedUserName, LocalData.ServerNotAuthorizedUserPass, WebApiUserTypesEnum.NotAuthorized); if (b) { timerHelper.OnTick = TimerTick; timerHelper.Start(1, 10000); } LocalData.AppHasGlobalError = true; } } } BlazorTimeAnalyzer.LogAll(); }