public static IList <string> ShowDebugInfos(this TempHelper itemsHelper, bool autoReset = true) { itemsHelper.EnabledRefresh(); var debugInfos = GetDebugInfos(itemsHelper); if (autoReset) { itemsHelper.Reset(); } return(debugInfos); }
private static IList <string> GetDebugInfos(TempHelper itemsHelper) { var infos = itemsHelper.Get(KeyDebugInfo, null) as IList <string>; if (infos == null) { infos = new List <string>(); itemsHelper.Set(KeyDebugInfo, infos); } return(infos); }
public static TempHelper Get(string helperKey, bool createIfNotExist) { if (Helpers.TryGetValue(helperKey, out var helper)) { return(helper); } if (!createIfNotExist) { return(null); } helper = new TempHelper(helperKey, new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase)); Helpers[helperKey] = helper; return(helper); }
public static void AppendDebugInfos(this TempHelper itemsHelper, object msg) { if (msg == null) { return; } if (!itemsHelper.IsEnabled()) { return; } var infos = GetDebugInfos(itemsHelper); infos.Add(msg.ToString()); }
public static void ClearDebugInfos(this TempHelper itemsHelper) { var infos = GetDebugInfos(itemsHelper); infos.Clear(); }