亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wrappermap.cs

?? 詳細講述了數據庫編程
?? CS
字號:
#region Copyright & License
//
// Copyright 2001-2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

using System;
using System.Collections;

using log4net.Repository;

namespace log4net.Core
{
	#region WrapperCreationHandler

	/// <summary>
	/// Delegate used to handle creation of new wrappers.
	/// </summary>
	/// <param name="logger">The logger to wrap in a wrapper.</param>
	/// <remarks>
	/// <para>
	/// Delegate used to handle creation of new wrappers. This delegate
	/// is called from the <see cref="WrapperMap.CreateNewWrapperObject"/>
	/// method to construct the wrapper for the specified logger.
	/// </para>
	/// <para>
	/// The delegate to use is supplied to the <see cref="WrapperMap"/>
	/// constructor.
	/// </para>
	/// </remarks>
	public delegate ILoggerWrapper WrapperCreationHandler(ILogger logger);

	#endregion WrapperCreationHandler

	/// <summary>
	/// Maps between logger objects and wrapper objects.
	/// </summary>
	/// <remarks>
	/// <para>
	/// This class maintains a mapping between <see cref="ILogger"/> objects and
	/// <see cref="ILoggerWrapper"/> objects. Use the <see cref="GetWrapper"/> method to 
	/// lookup the <see cref="ILoggerWrapper"/> for the specified <see cref="ILogger"/>.
	/// </para>
	/// <para>
	/// New wrapper instances are created by the <see cref="CreateNewWrapperObject"/>
	/// method. The default behavior is for this method to delegate construction
	/// of the wrapper to the <see cref="WrapperCreationHandler"/> delegate supplied
	/// to the constructor. This allows specialization of the behavior without
	/// requiring subclassing of this type.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
	public class WrapperMap
	{
		#region Public Instance Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="WrapperMap" />
		/// </summary>
		/// <param name="createWrapperHandler">The handler to use to create the wrapper objects.</param>
		/// <remarks>
		/// <para>
		/// Initializes a new instance of the <see cref="WrapperMap" /> class with 
		/// the specified handler to create the wrapper objects.
		/// </para>
		/// </remarks>
		public WrapperMap(WrapperCreationHandler createWrapperHandler) 
		{
			m_createWrapperHandler = createWrapperHandler;

			// Create the delegates for the event callbacks
			m_shutdownHandler = new LoggerRepositoryShutdownEventHandler(ILoggerRepository_Shutdown);
		}

		#endregion Public Instance Constructors

		#region Public Instance Properties

		/// <summary>
		/// Gets the wrapper object for the specified logger.
		/// </summary>
		/// <returns>The wrapper object for the specified logger</returns>
		/// <remarks>
		/// <para>
		/// If the logger is null then the corresponding wrapper is null.
		/// </para>
		/// <para>
		/// Looks up the wrapper it it has previously been requested and
		/// returns it. If the wrapper has never been requested before then
		/// the <see cref="CreateNewWrapperObject"/> virtual method is
		/// called.
		/// </para>
		/// </remarks>
		virtual public ILoggerWrapper GetWrapper(ILogger logger)
		{
			// If the logger is null then the corresponding wrapper is null
			if (logger == null)
			{
				return null;
			}

			lock(this)
			{
				// Lookup hierarchy in map.
				Hashtable wrappersMap = (Hashtable)m_repositories[logger.Repository];

				if (wrappersMap == null)
				{
					// Hierarchy does not exist in map.
					// Must register with hierarchy

					wrappersMap = new Hashtable();
					m_repositories[logger.Repository] = wrappersMap;

					// Register for config reset & shutdown on repository
					logger.Repository.ShutdownEvent += m_shutdownHandler;
				}

				// Look for the wrapper object in the map
				ILoggerWrapper wrapperObject = wrappersMap[logger] as ILoggerWrapper;

				if (wrapperObject == null)
				{
					// No wrapper object exists for the specified logger

					// Create a new wrapper wrapping the logger
					wrapperObject = CreateNewWrapperObject(logger);
					
					// Store wrapper logger in map
					wrappersMap[logger] = wrapperObject;
				}

				return wrapperObject;
			}
		}

		#endregion Public Instance Properties

		#region Protected Instance Properties

		/// <summary>
		/// Gets the map of logger repositories.
		/// </summary>
		/// <value>
		/// Map of logger repositories.
		/// </value>
		/// <remarks>
		/// <para>
		/// Gets the hashtable that is keyed on <see cref="ILoggerRepository"/>. The
		/// values are hashtables keyed on <see cref="ILogger"/> with the
		/// value being the corresponding <see cref="ILoggerWrapper"/>.
		/// </para>
		/// </remarks>
		protected Hashtable Repositories 
		{
			get { return this.m_repositories; }
		}

		#endregion Protected Instance Properties

		#region Protected Instance Methods

		/// <summary>
		/// Creates the wrapper object for the specified logger.
		/// </summary>
		/// <param name="logger">The logger to wrap in a wrapper.</param>
		/// <returns>The wrapper object for the logger.</returns>
		/// <remarks>
		/// <para>
		/// This implementation uses the <see cref="WrapperCreationHandler"/>
		/// passed to the constructor to create the wrapper. This method
		/// can be overridden in a subclass.
		/// </para>
		/// </remarks>
		virtual protected ILoggerWrapper CreateNewWrapperObject(ILogger logger)
		{
			if (m_createWrapperHandler != null)
			{
				return m_createWrapperHandler(logger);
			}
			return null;
		}

		/// <summary>
		/// Called when a monitored repository shutdown event is received.
		/// </summary>
		/// <param name="repository">The <see cref="ILoggerRepository"/> that is shutting down</param>
		/// <remarks>
		/// <para>
		/// This method is called when a <see cref="ILoggerRepository"/> that this
		/// <see cref="WrapperMap"/> is holding loggers for has signaled its shutdown
		/// event <see cref="ILoggerRepository.ShutdownEvent"/>. The default
		/// behavior of this method is to release the references to the loggers
		/// and their wrappers generated for this repository.
		/// </para>
		/// </remarks>
		virtual protected void RepositoryShutdown(ILoggerRepository repository)
		{
			lock(this)
			{
				// Remove the repository from map
				m_repositories.Remove(repository);

				// Unhook events from the repository
				repository.ShutdownEvent -= m_shutdownHandler;
			}
		}

		/// <summary>
		/// Event handler for repository shutdown event.
		/// </summary>
		/// <param name="sender">The sender of the event.</param>
		/// <param name="e">The event args.</param>
		private void ILoggerRepository_Shutdown(object sender, EventArgs e)
		{
			ILoggerRepository repository = sender as ILoggerRepository;
			if (repository != null)
			{
				// Remove all repository from map
				RepositoryShutdown(repository);
			}
		}

		#endregion Protected Instance Methods

		#region Private Instance Variables

		/// <summary>
		/// Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings
		/// </summary>
		private readonly Hashtable m_repositories = new Hashtable();

		/// <summary>
		/// The handler to use to create the extension wrapper objects.
		/// </summary>
		private readonly WrapperCreationHandler m_createWrapperHandler;

		/// <summary>
		/// Internal reference to the delegate used to register for repository shutdown events.
		/// </summary>
		private readonly LoggerRepositoryShutdownEventHandler m_shutdownHandler;
 
		#endregion Private Instance Variables
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美精品一区二区色综合朱莉| 99re热这里只有精品视频| 91精品国产综合久久久久久久 | 久久久久久一级片| 国产高清无密码一区二区三区| 国产亚洲午夜高清国产拍精品| 激情五月婷婷综合网| 久久久久国色av免费看影院| 夫妻av一区二区| 亚洲小少妇裸体bbw| 91精品国产黑色紧身裤美女| 精品一二三四区| 亚洲视频每日更新| 欧美日韩一级大片网址| 久久99久久久久| 欧美国产日产图区| 色94色欧美sute亚洲13| 日韩成人一区二区| 国产欧美一区二区在线| 色综合av在线| 精品在线播放免费| 国产精品毛片高清在线完整版| 色94色欧美sute亚洲线路一久| 日韩精品亚洲一区| 欧美国产禁国产网站cc| 欧美日韩免费观看一区三区| 精品午夜一区二区三区在线观看| 国产精品美女久久久久久| 欧美日韩精品一二三区| 国产精品一区一区| 日日骚欧美日韩| 日本一区二区三区视频视频| 欧美色涩在线第一页| 国产精品69久久久久水密桃 | 蜜桃视频在线一区| 中文字幕一区不卡| 精品美女一区二区| 色婷婷亚洲婷婷| 国产凹凸在线观看一区二区| 天天av天天翘天天综合网色鬼国产| 国产天堂亚洲国产碰碰| 91精品国产91久久综合桃花| 色一情一乱一乱一91av| 国内精品国产成人国产三级粉色| 亚洲综合在线视频| 日本一二三四高清不卡| 日韩一级成人av| 日本韩国一区二区三区视频| 国产福利精品一区二区| 日韩二区三区四区| 伊人开心综合网| 国产欧美视频在线观看| 欧美成人欧美edvon| 欧美日韩在线播| 色婷婷久久综合| 99精品久久久久久| 国产激情偷乱视频一区二区三区| 美女久久久精品| 日本免费在线视频不卡一不卡二| 亚洲色图视频网站| 亚洲国产精华液网站w| www国产精品av| 欧美一区二区三区免费在线看 | 成人一级片网址| 国产精品夜夜嗨| 国产剧情av麻豆香蕉精品| 毛片一区二区三区| 三级影片在线观看欧美日韩一区二区| 亚洲精品久久久蜜桃| 亚洲天堂福利av| 国产精品美女一区二区在线观看| 久久久99精品免费观看不卡| 337p日本欧洲亚洲大胆精品| 日韩欧美中文字幕制服| 91精品国产综合久久精品| 91麻豆精品国产91久久久久久 | 日韩欧美中文字幕公布| 日韩视频不卡中文| 精品国产乱子伦一区| 精品少妇一区二区三区在线播放| 精品裸体舞一区二区三区| 日韩精品综合一本久道在线视频| 777午夜精品视频在线播放| 91精品国产高清一区二区三区| 91精品国产入口在线| 欧美mv日韩mv国产网站| 久久久精品免费免费| 中文字幕欧美激情| 国产精品久久久久久久久果冻传媒| 国产精品久久久久永久免费观看| 国产精品免费人成网站| 亚洲激情自拍偷拍| 水野朝阳av一区二区三区| 蜜臀99久久精品久久久久久软件| 国产一区二区导航在线播放| 丁香婷婷深情五月亚洲| 色综合久久久网| 欧美二区在线观看| 久久青草欧美一区二区三区| 国产精品久久网站| 亚洲成av人片一区二区| 麻豆成人在线观看| 99久久免费精品| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲欧美日韩中文播放 | 亚洲成人综合视频| 久久se这里有精品| av在线播放一区二区三区| 日本道精品一区二区三区| 在线播放欧美女士性生活| 精品久久久久久久久久久久包黑料 | 中文字幕在线观看一区| 亚洲国产精品一区二区久久恐怖片| 狂野欧美性猛交blacked| caoporen国产精品视频| 欧美一区二区视频网站| 中文字幕一区二区视频| 婷婷中文字幕一区三区| 成人免费的视频| 日韩免费福利电影在线观看| 国产日韩v精品一区二区| 洋洋成人永久网站入口| 国产精品99久久久| 欧美精品乱码久久久久久按摩| 久久久www免费人成精品| 亚洲va欧美va天堂v国产综合| 国产精品 日产精品 欧美精品| 欧美日韩国产一二三| 国产喷白浆一区二区三区| 天天综合网 天天综合色| 成人avav影音| 精品国产1区二区| 午夜精品视频在线观看| 99在线精品观看| 国产亚洲欧美激情| 免费不卡在线观看| 欧美在线免费观看视频| 国产人妖乱国产精品人妖| 亚洲成人午夜电影| 91免费视频网| 久久精品欧美一区二区三区不卡| 亚洲午夜羞羞片| 99久久国产综合色|国产精品| 精品日韩一区二区| 日本不卡视频在线| 91福利国产精品| 亚洲欧美日韩久久精品| 成人精品视频网站| 久久久亚洲国产美女国产盗摄| 日本va欧美va欧美va精品| 欧美日本高清视频在线观看| 一区二区三区四区亚洲| 99vv1com这只有精品| 国产精品久久三区| 国产91露脸合集magnet| 久久精品一二三| 九色|91porny| 日韩视频永久免费| 日日夜夜精品免费视频| 337p亚洲精品色噜噜| 婷婷成人激情在线网| 欧美三级欧美一级| 亚洲va欧美va人人爽午夜| 欧美日韩视频一区二区| 亚洲大片在线观看| 欧美日韩日日骚| 日日夜夜免费精品视频| 91精品国产欧美一区二区| 青青草一区二区三区| 精品国产一区a| 国产综合久久久久久鬼色| www激情久久| 国产成a人无v码亚洲福利| 中文字幕在线一区免费| 一本久道中文字幕精品亚洲嫩| 夜夜爽夜夜爽精品视频| 欧美体内she精视频| 天天色综合成人网| 精品理论电影在线| 国产91在线观看丝袜| 国产精品色眯眯| 一本大道久久a久久综合婷婷| 亚洲一区二区四区蜜桃| 91精品啪在线观看国产60岁| 日本不卡123| 欧美国产禁国产网站cc| 日本韩国精品在线| 日韩精品成人一区二区在线| 日韩视频中午一区| 成人动漫一区二区| 亚洲成av人片一区二区梦乃 | 国产一区二区三区免费观看| 中日韩免费视频中文字幕| 99国产欧美另类久久久精品| 亚洲国产综合人成综合网站| 日韩情涩欧美日韩视频| 99精品国产99久久久久久白柏| 亚洲成av人片在www色猫咪| 2022国产精品视频| 色综合久久综合中文综合网|