コード例 #1
0
        public static IList <string> ShowDebugInfos(this TempHelper itemsHelper, bool autoReset = true)
        {
            itemsHelper.EnabledRefresh();
            var debugInfos = GetDebugInfos(itemsHelper);

            if (autoReset)
            {
                itemsHelper.Reset();
            }
            return(debugInfos);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        public static void ClearDebugInfos(this TempHelper itemsHelper)
        {
            var infos = GetDebugInfos(itemsHelper);

            infos.Clear();
        }