public static void LogAll() { if (!DevelopmentMode) { return; } if (list.Any()) { Calculate(); BWHJsInterop.JsLog("=============== time report - " + ReportName + " =============="); BWHJsInterop.JsLog("N === Name === Description === Method === Start === End === Duration === Percentage"); foreach (var item in list) { BWHJsInterop.JsLog(item.ID + " " + item.Name + " " + item.Description + " " + item.Method + " " + item.StartDate.ToString("HH:mm:ss.fff") + " " + item.EndDate.ToString("HH:mm:ss.fff") + " " + item.Duration.ToString(@"hh\:mm\:ss\.fff") + " " + item.Percentage + "%"); } BWHJsInterop.JsLog("=============== report end =============="); Reset(); } else { BWHJsInterop.JsLog("===!!! Was called log method but list is empty !!!==="); } }
public static async void CheckIfMobile() { double w = await BWHJsInterop.GetWindowWidth(); double h = await BWHJsInterop.GetWindowHeight(); if (h > w) { await BWHJsInterop.Alert("Sorry this app isn't designed for mobile screen, please use desktop. You see this because screen height is more than width."); } }
public static void Add(string Par_Name, MethodBase Par_Method, string Par_Description = "NA") { if (!DevelopmentMode) { return; } TimeTask t = new TimeTask { ID = list.Count + 1, Name = Par_Name, Description = Par_Description, Method = BWHelperFunctions.getMethodName(Par_Method), StartDate = DateTime.Now, }; list.Add(t); if (LogAllAddition) { BWHJsInterop.JsLog("added new TimeAnalyzer item - " + t.ID + " " + t.Name + " " + t.Description + " " + t.Method + " " + t.StartDate.ToString("HH:mm:ss.fff")); } }