Exemplo n.º 1
0
        /// <summary>
        /// 渲染一个Cache队列的内容
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="queueInfo"></param>
        private static void RenderQueueInfo(HtmlTextWriter writer, CacheQueueInfo queueInfo)
        {
            writer.WriteBeginTag("div");

            writer.WriteAttribute("class", "queueInfoTitle");
            writer.Write(">");

            writer.Write(HttpUtility.HtmlEncode(GetQueueInfo(queueInfo)));

            RenderCacheQueueClearButton(writer, queueInfo.QueueTypeFullName);

            writer.WriteEndTag("div");

            RenderCacheQueueItemsInfo(writer, queueInfo);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 渲染每一条Cache项
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="queueInfo"></param>
        private static void RenderCacheQueueItemsInfo(HtmlTextWriter writer, CacheQueueInfo queueInfo)
        {
            Type type = TypeCreator.GetTypeInfo(queueInfo.QueueTypeFullName);

            CacheQueueBase cacheQueue = CacheManager.GetInstance(type);

            CacheItemInfoCollection itemsInfo = cacheQueue.GetAllItemsInfo();

            foreach (CacheItemInfo itemInfo in itemsInfo)
            {
                writer.WriteBeginTag("div");

                writer.WriteAttribute("class", "queueInfoDetail");
                writer.Write(">");

                writer.Write(HttpUtility.HtmlEncode(string.Format("Key={0}, Value={1}", itemInfo.Key, itemInfo.Value)));

                writer.WriteEndTag("div");
            }
        }
Exemplo n.º 4
0
		/// <summary>
		/// 增加一项
		/// </summary>
		/// <param name="info"></param>
		internal void Add(CacheQueueInfo info)
		{
			List.Add(info);
		}
Exemplo n.º 5
0
 /// <summary>
 /// 增加一项
 /// </summary>
 /// <param name="info"></param>
 internal void Add(CacheQueueInfo info)
 {
     List.Add(info);
 }
Exemplo n.º 6
0
 private static string GetQueueInfo(CacheQueueInfo queueInfo)
 {
     return(string.Format("{0},项数为{1:#,##0}", queueInfo.QueueTypeName, queueInfo.Count));
 }
Exemplo n.º 7
0
 private static string GetQueueInfo(CacheQueueInfo queueInfo)
 {
     return string.Format("{0},项数为{1:#,##0}", queueInfo.QueueTypeName, queueInfo.Count);
 }
Exemplo n.º 8
0
        /// <summary>
        /// 渲染每一条Cache项
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="queueInfo"></param>
        private static void RenderCacheQueueItemsInfo(HtmlTextWriter writer, CacheQueueInfo queueInfo)
        {
            Type type = TypeCreator.GetTypeInfo(queueInfo.QueueTypeFullName);

            CacheQueueBase cacheQueue = CacheManager.GetInstance(type);

            CacheItemInfoCollection itemsInfo = cacheQueue.GetAllItemsInfo();

            foreach (CacheItemInfo itemInfo in itemsInfo)
            {
                writer.WriteBeginTag("div");

                writer.WriteAttribute("class", "queueInfoDetail");
                writer.Write(">");

                writer.Write(HttpUtility.HtmlEncode(string.Format("Key={0}, Value={1}", itemInfo.Key, itemInfo.Value)));

                writer.WriteEndTag("div");
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 渲染一个Cache队列的内容
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="queueInfo"></param>
        private static void RenderQueueInfo(HtmlTextWriter writer, CacheQueueInfo queueInfo)
        {
            writer.WriteBeginTag("div");

            writer.WriteAttribute("class", "queueInfoTitle");
            writer.Write(">");

            writer.Write(HttpUtility.HtmlEncode(GetQueueInfo(queueInfo)));

            RenderCacheQueueClearButton(writer, queueInfo.QueueTypeFullName);

            writer.WriteEndTag("div");

            RenderCacheQueueItemsInfo(writer, queueInfo);
        }