예제 #1
0
        private static void ShowCacheInfo()
        {
            CacheQueueInfoCollection queues = CacheManager.GetAllCacheInfo();

            string template = GetPageTemplate();

            template = template.Replace("$Summary$", GetSummary(queues));

            string queuesInfo = GetAllQueueInfo(queues);

            template = template.Replace("$QueueInfoLines$", GetAllQueueInfo(queues));

            HttpContext.Current.Response.Write(template);
        }
예제 #2
0
        private static string GetAllQueueInfo(CacheQueueInfoCollection queues)
        {
            StringBuilder strB = new StringBuilder();

            using (TextWriter sw = new StringWriter(strB))
            {
                HtmlTextWriter writer = new HtmlTextWriter(sw);

                foreach (CacheQueueInfo queueInfo in queues)
                {
                    RenderQueueInfo(writer, queueInfo);
                }

                return(strB.ToString());
            }
        }
예제 #3
0
        private static string GetSummary(CacheQueueInfoCollection queues)
        {
            StringBuilder strB = new StringBuilder();

            using (TextWriter sw = new StringWriter(strB))
            {
                HtmlTextWriter writer = new HtmlTextWriter(sw);

                if (queues.Count > 0)
                {
                    writer.Write("(总共{0}个缓存队列)", queues.Count);

                    RenderCacheQueueClearButton(writer, "ClearAllCache");
                }
            }

            return(strB.ToString());
        }
예제 #4
0
        /// <summary>
        /// 获得所有Cache队列的信息
        /// </summary>
        /// <returns></returns>
        public static CacheQueueInfoCollection GetAllCacheInfo()
        {
            CacheQueueInfoCollection result = new CacheQueueInfoCollection();

            lock (((IDictionary)CacheManager.innerCacheQueues).SyncRoot)
            {
                foreach (KeyValuePair <Type, CacheQueueBase> kp in CacheManager.innerCacheQueues)
                {
                    CacheQueueInfo queueInfo = new CacheQueueInfo();

                    queueInfo.QueueTypeName     = kp.Key.FullName;
                    queueInfo.QueueTypeFullName = kp.Key.AssemblyQualifiedName;
                    queueInfo.Count             = kp.Value.Count;

                    result.Add(queueInfo);
                }
            }

            return(result);
        }
예제 #5
0
        private static string GetAllQueueInfo(CacheQueueInfoCollection queues)
        {
            StringBuilder strB = new StringBuilder();

            using (TextWriter sw = new StringWriter(strB))
            {
                HtmlTextWriter writer = new HtmlTextWriter(sw);

                foreach (CacheQueueInfo queueInfo in queues)
                    RenderQueueInfo(writer, queueInfo);

                return strB.ToString();
            }
        }
예제 #6
0
        private static string GetSummary(CacheQueueInfoCollection queues)
		{
			StringBuilder strB = new StringBuilder();

			using (TextWriter sw = new StringWriter(strB))
			{
			    HtmlTextWriter writer = new HtmlTextWriter(sw);
				
                if (queues.Count > 0)
				{
					writer.Write("(总共{0}个缓存队列)", queues.Count);

					RenderCacheQueueClearButton(writer, "ClearAllCache");
				}
			}

			return strB.ToString();
		}