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

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

?? compactrepositoryselector.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 System.Reflection;

using log4net.Appender;
using log4net.Util;
using log4net.Repository;


namespace log4net.Core
{
	/// <summary>
	/// The implementation of the <see cref="IRepositorySelector"/> interface suitable
	/// for use with the compact framework
	/// </summary>
	/// <remarks>
	/// <para>
	/// This <see cref="IRepositorySelector"/> implementation is a simple
	/// mapping between repository name and <see cref="ILoggerRepository"/>
	/// object.
	/// </para>
	/// <para>
	/// The .NET Compact Framework 1.0 does not support retrieving assembly
	/// level attributes therefore unlike the <c>DefaultRepositorySelector</c>
	/// this selector does not examine the calling assembly for attributes.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	public class CompactRepositorySelector : IRepositorySelector
	{
		#region Member Variables

		private const string DefaultRepositoryName = "log4net-default-repository";

		private readonly Hashtable m_name2repositoryMap = new Hashtable();
		private readonly Type m_defaultRepositoryType;

		private event LoggerRepositoryCreationEventHandler m_loggerRepositoryCreatedEvent;

		#endregion

		#region Constructors

		/// <summary>
		/// Create a new repository selector
		/// </summary>
		/// <param name="defaultRepositoryType">the type of the repositories to create, must implement <see cref="ILoggerRepository"/></param>
		/// <remarks>
		/// <para>
		/// Create an new compact repository selector.
		/// The default type for repositories must be specified,
		/// an appropriate value would be <see cref="log4net.Repository.Hierarchy.Hierarchy"/>.
		/// </para>
		/// </remarks>
		/// <exception cref="ArgumentNullException">throw if <paramref name="defaultRepositoryType"/> is null</exception>
		/// <exception cref="ArgumentOutOfRangeException">throw if <paramref name="defaultRepositoryType"/> does not implement <see cref="ILoggerRepository"/></exception>
		public CompactRepositorySelector(Type defaultRepositoryType)
		{
			if (defaultRepositoryType == null)
			{
				throw new ArgumentNullException("defaultRepositoryType");
			}

			// Check that the type is a repository
			if (! (typeof(ILoggerRepository).IsAssignableFrom(defaultRepositoryType)) )
			{
				throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("defaultRepositoryType", (object)defaultRepositoryType, "Parameter: defaultRepositoryType, Value: ["+defaultRepositoryType+"] out of range. Argument must implement the ILoggerRepository interface");
			}

			m_defaultRepositoryType = defaultRepositoryType;

			LogLog.Debug("CompactRepositorySelector: defaultRepositoryType ["+m_defaultRepositoryType+"]");
		}

		#endregion

		#region Implementation of IRepositorySelector

		/// <summary>
		/// Get the <see cref="ILoggerRepository"/> for the specified assembly
		/// </summary>
		/// <param name="assembly">not used</param>
		/// <returns>The default <see cref="ILoggerRepository"/></returns>
		/// <remarks>
		/// <para>
		/// The <paramref name="assembly"/> argument is not used. This selector does not create a
		/// separate repository for each assembly. 
		/// </para>
		/// <para>
		/// As a named repository is not specified the default repository is 
		/// returned. The default repository is named <c>log4net-default-repository</c>.
		/// </para>
		/// </remarks>
		public ILoggerRepository GetRepository(Assembly assembly)
		{
			return CreateRepository(assembly, m_defaultRepositoryType);
		}

		/// <summary>
		/// Get the named <see cref="ILoggerRepository"/>
		/// </summary>
		/// <param name="repositoryName">the name of the repository to lookup</param>
		/// <returns>The named <see cref="ILoggerRepository"/></returns>
		/// <remarks>
		/// <para>
		/// Get the named <see cref="ILoggerRepository"/>. The default 
		/// repository is <c>log4net-default-repository</c>. Other repositories 
		/// must be created using the <see cref="CreateRepository(string, Type)"/>.
		/// If the named repository does not exist an exception is thrown.
		/// </para>
		/// </remarks>
		/// <exception cref="ArgumentNullException">throw if <paramref name="repositoryName"/> is null</exception>
		/// <exception cref="LogException">throw if the <paramref name="repositoryName"/> does not exist</exception>
		public ILoggerRepository GetRepository(string repositoryName)
		{
			if (repositoryName == null)
			{
				throw new ArgumentNullException("repositoryName");
			}

			lock(this)
			{
				// Lookup in map
				ILoggerRepository rep = m_name2repositoryMap[repositoryName] as ILoggerRepository;
				if (rep == null)
				{
					throw new LogException("Repository ["+repositoryName+"] is NOT defined.");
				}
				return rep;
			}
		}

		/// <summary>
		/// Create a new repository for the assembly specified 
		/// </summary>
		/// <param name="assembly">not used</param>
		/// <param name="repositoryType">the type of repository to create, must implement <see cref="ILoggerRepository"/></param>
		/// <returns>the repository created</returns>
		/// <remarks>
		/// <para>
		/// The <paramref name="assembly"/> argument is not used. This selector does not create a
		/// separate repository for each assembly. 
		/// </para>
		/// <para>
		/// If the <paramref name="repositoryType"/> is <c>null</c> then the
		/// default repository type specified to the constructor is used.
		/// </para>
		/// <para>
		/// As a named repository is not specified the default repository is 
		/// returned. The default repository is named <c>log4net-default-repository</c>.
		/// </para>
		/// </remarks>
		public ILoggerRepository CreateRepository(Assembly assembly, Type repositoryType)
		{
			// If the type is not set then use the default type
			if (repositoryType == null)
			{
				repositoryType = m_defaultRepositoryType;
			}

			lock(this)
			{
				// This method should not throw if the default repository already exists.

				// First check that the repository does not exist
				ILoggerRepository rep = m_name2repositoryMap[DefaultRepositoryName] as ILoggerRepository;
				if (rep == null)
				{
					// Must create the repository
					rep = CreateRepository(DefaultRepositoryName, repositoryType);
				}

				return rep;
			}		
		}

		/// <summary>
		/// Create a new repository for the repository specified
		/// </summary>
		/// <param name="repositoryName">the repository to associate with the <see cref="ILoggerRepository"/></param>
		/// <param name="repositoryType">the type of repository to create, must implement <see cref="ILoggerRepository"/>.
		/// If this param is null then the default repository type is used.</param>
		/// <returns>the repository created</returns>
		/// <remarks>
		/// <para>
		/// The <see cref="ILoggerRepository"/> created will be associated with the repository
		/// specified such that a call to <see cref="GetRepository(string)"/> with the
		/// same repository specified will return the same repository instance.
		/// </para>
		/// <para>
		/// If the named repository already exists an exception will be thrown.
		/// </para>
		/// <para>
		/// If <paramref name="repositoryType"/> is <c>null</c> then the default 
		/// repository type specified to the constructor is used.
		/// </para>
		/// </remarks>
		/// <exception cref="ArgumentNullException">throw if <paramref name="repositoryName"/> is null</exception>
		/// <exception cref="LogException">throw if the <paramref name="repositoryName"/> already exists</exception>
		public ILoggerRepository CreateRepository(string repositoryName, Type repositoryType)
		{
			if (repositoryName == null)
			{
				throw new ArgumentNullException("repositoryName");
			}

			// If the type is not set then use the default type
			if (repositoryType == null)
			{
				repositoryType = m_defaultRepositoryType;
			}

			lock(this)
			{
				ILoggerRepository rep = null;

				// First check that the repository does not exist
				rep = m_name2repositoryMap[repositoryName] as ILoggerRepository;
				if (rep != null)
				{
					throw new LogException("Repository ["+repositoryName+"] is already defined. Repositories cannot be redefined.");
				}
				else
				{
					LogLog.Debug("DefaultRepositorySelector: Creating repository ["+repositoryName+"] using type ["+repositoryType+"]");

					// Call the no arg constructor for the repositoryType
					rep = (ILoggerRepository)Activator.CreateInstance(repositoryType);

					// Set the name of the repository
					rep.Name = repositoryName;

					// Store in map
					m_name2repositoryMap[repositoryName] = rep;

					// Notify listeners that the repository has been created
					OnLoggerRepositoryCreatedEvent(rep);
				}

				return rep;
			}
		}

		/// <summary>
		/// Test if a named repository exists
		/// </summary>
		/// <param name="repositoryName">the named repository to check</param>
		/// <returns><c>true</c> if the repository exists</returns>
		/// <remarks>
		/// <para>
		/// Test if a named repository exists. Use <see cref="CreateRepository(string, Type)"/>
		/// to create a new repository and <see cref="GetRepository(string)"/> to retrieve 
		/// a repository.
		/// </para>
		/// </remarks>
		public bool ExistsRepository(string repositoryName)
		{
			lock(this)
			{
				return m_name2repositoryMap.ContainsKey(repositoryName);
			}
		}

		/// <summary>
		/// Gets a list of <see cref="ILoggerRepository"/> objects
		/// </summary>
		/// <returns>an array of all known <see cref="ILoggerRepository"/> objects</returns>
		/// <remarks>
		/// <para>
		/// Gets an array of all of the repositories created by this selector.
		/// </para>
		/// </remarks>
		public ILoggerRepository[] GetAllRepositories()
		{
			lock(this)
			{
				ICollection reps = m_name2repositoryMap.Values;
				ILoggerRepository[] all = new ILoggerRepository[reps.Count];
				reps.CopyTo(all, 0);
				return all;
			}
		}

		#endregion

		/// <summary>
		/// Event to notify that a logger repository has been created.
		/// </summary>
		/// <value>
		/// Event to notify that a logger repository has been created.
		/// </value>
		/// <remarks>
		/// <para>
		/// Event raised when a new repository is created.
		/// The event source will be this selector. The event args will
		/// be a <see cref="LoggerRepositoryCreationEventArgs"/> which
		/// holds the newly created <see cref="ILoggerRepository"/>.
		/// </para>
		/// </remarks>
		public event LoggerRepositoryCreationEventHandler LoggerRepositoryCreatedEvent
		{
			add { m_loggerRepositoryCreatedEvent += value; }
			remove { m_loggerRepositoryCreatedEvent -= value; }
		}

		/// <summary>
		/// Notify the registered listeners that the repository has been created
		/// </summary>
		/// <param name="repository">The repository that has been created</param>
		/// <remarks>
		/// <para>
		/// Raises the <event cref="LoggerRepositoryCreatedEvent">LoggerRepositoryCreatedEvent</event>
		/// event.
		/// </para>
		/// </remarks>
		protected virtual void OnLoggerRepositoryCreatedEvent(ILoggerRepository repository)
		{
			LoggerRepositoryCreationEventHandler handler = m_loggerRepositoryCreatedEvent;
			if (handler != null)
			{
				handler(this, new LoggerRepositoryCreationEventArgs(repository));
			}
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄页毛片网站| 国产亚洲一区二区三区| 亚洲色图一区二区| 成人激情综合网站| 亚洲三级在线免费观看| 91免费国产在线| 亚洲成a人片综合在线| 欧美美女一区二区| 久久精品国内一区二区三区| 日韩午夜激情视频| 国产成a人亚洲精| 亚洲精品videosex极品| 欧美日韩高清一区| 国内久久精品视频| 亚洲美女屁股眼交3| 4438成人网| 从欧美一区二区三区| 综合精品久久久| 制服丝袜日韩国产| 粉嫩av一区二区三区粉嫩| 一区二区三区在线免费观看| 91精品国产综合久久久久久| 国产成人免费在线观看| 亚洲午夜在线视频| 久久毛片高清国产| 欧美日韩国产经典色站一区二区三区| 麻豆久久久久久久| 亚洲色图一区二区三区| 欧美成人激情免费网| 99re这里都是精品| 麻豆国产一区二区| 亚洲黄色小说网站| 久久久久久黄色| 欧美日韩一区二区欧美激情| 国产成人高清在线| 日本免费新一区视频| 中文字幕日韩一区| 精品国产凹凸成av人导航| 色综合欧美在线| 高清不卡在线观看av| 午夜欧美电影在线观看| 亚洲欧洲国产日本综合| 日韩美女视频一区二区在线观看| www.在线成人| 狠狠色丁香婷综合久久| 亚洲一区二区三区视频在线播放| 国产亚洲欧美激情| 欧美一卡二卡三卡| 欧美影视一区在线| caoporn国产一区二区| 精品午夜久久福利影院| 亚洲3atv精品一区二区三区| 国产精品久久久久久久久快鸭| 日韩一级成人av| 欧美日本国产视频| 色吊一区二区三区| www.日本不卡| 国产成人免费高清| 国产一区视频网站| 极品美女销魂一区二区三区| 天天操天天综合网| 亚洲第一二三四区| 亚洲激情图片小说视频| 中文字幕一区在线| 亚洲天堂福利av| 国产精品久久久久影院亚瑟| 国产色91在线| 久久精品欧美一区二区三区不卡 | 成人性视频网站| 激情综合亚洲精品| 黑人精品欧美一区二区蜜桃| 蜜桃在线一区二区三区| 男男gaygay亚洲| 日本欧美一区二区| 看国产成人h片视频| 狠狠久久亚洲欧美| 国产在线不卡一卡二卡三卡四卡| 麻豆精品视频在线观看视频| 另类调教123区| 国产精品影视在线| 成人丝袜18视频在线观看| 成人午夜免费视频| 99久久久精品免费观看国产蜜| 91老师片黄在线观看| 一本色道久久综合精品竹菊| 在线视频中文字幕一区二区| 欧美日韩一级黄| 欧美一级xxx| 精品国产精品网麻豆系列| 国产视频视频一区| 亚洲精品美腿丝袜| 香蕉成人伊视频在线观看| 日本vs亚洲vs韩国一区三区二区 | 亚洲免费av网站| 亚洲国产精品久久人人爱| 图片区小说区区亚洲影院| 蜜臀久久久99精品久久久久久| 精品一区二区三区久久| 99视频一区二区三区| 欧美日韩在线播放三区| 日韩免费看网站| 国产精品视频免费看| 亚洲丝袜美腿综合| 日韩在线一区二区| 国产一区二区美女| 色综合视频在线观看| 日韩欧美一区二区久久婷婷| 久久精品无码一区二区三区| 亚洲色图清纯唯美| 蜜臀久久99精品久久久久宅男| 成人性生交大片免费看中文网站| 色综合久久99| 欧美成人精精品一区二区频| 1区2区3区精品视频| 天天综合网 天天综合色| 国产在线播放一区三区四| 91蜜桃网址入口| 欧美不卡123| 亚洲人成网站影音先锋播放| 免费观看成人鲁鲁鲁鲁鲁视频| 大陆成人av片| 91精品国产色综合久久不卡蜜臀| 中文字幕精品—区二区四季| 日韩中文字幕91| 91网站在线播放| 久久日韩精品一区二区五区| 亚洲午夜三级在线| 国产成人av影院| 日韩一级高清毛片| 亚洲第一搞黄网站| 成人18精品视频| 精品福利一二区| 五月婷婷激情综合| 色婷婷激情一区二区三区| 久久综合色一综合色88| 亚洲成人黄色影院| 99在线精品免费| 欧美经典一区二区| 久久aⅴ国产欧美74aaa| 欧美网站大全在线观看| 中文字幕在线不卡国产视频| 国产剧情一区在线| 欧美一区二区三区视频在线| 亚洲麻豆国产自偷在线| 成人开心网精品视频| 26uuu色噜噜精品一区二区| 偷拍与自拍一区| 欧美日韩精品一区二区三区蜜桃 | 欧美tk—视频vk| 日本亚洲视频在线| 欧美精选午夜久久久乱码6080| 亚洲欧洲www| 成人免费视频网站在线观看| 亚洲精品在线免费播放| 日本成人在线网站| 欧美日韩综合不卡| 亚洲一区二区三区爽爽爽爽爽| 91网站在线观看视频| 中文字幕在线不卡一区二区三区 | 一二三区精品视频| 国内精品伊人久久久久av影院| 欧美日韩国产一区二区三区地区| 亚洲免费观看高清完整版在线观看熊| 婷婷综合另类小说色区| 成人免费av资源| 国产亚洲精久久久久久| 国产一区二区91| 久久夜色精品国产噜噜av| 久久国产精品区| 日韩欧美www| 国产一区二区三区精品欧美日韩一区二区三区 | 色香蕉久久蜜桃| 亚洲狠狠丁香婷婷综合久久久| 色综合中文综合网| 自拍偷自拍亚洲精品播放| 成人ar影院免费观看视频| 国产精品少妇自拍| 97久久超碰精品国产| 亚洲欧美日韩在线不卡| 欧美成人vr18sexvr| 精品一区二区三区日韩| 精品日韩一区二区三区| 国产一区二区在线影院| 国产丝袜在线精品| 成人精品一区二区三区中文字幕| 国产日韩成人精品| 久久一日本道色综合| 在线亚洲高清视频| 国产欧美va欧美不卡在线| 成人自拍视频在线观看| 亚洲日本欧美天堂| 91精品在线免费| 国产毛片一区二区| 亚洲欧美区自拍先锋| 欧美日韩国产综合久久| 国内欧美视频一区二区| 亚洲欧美日韩国产综合| 91精品国产美女浴室洗澡无遮挡| 精品一区二区精品| 亚洲人精品午夜|