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

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

?? defaultrepositoryselector.cs

?? 詳細講述了數據庫編程
?? CS
?? 第 1 頁 / 共 3 頁
字號:
		/// Gets the repository name and repository type for the specified assembly.
		/// </summary>
		/// <param name="assembly">The assembly that has a <see cref="log4net.Config.RepositoryAttribute"/>.</param>
		/// <param name="repositoryName">in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling.</param>
		/// <param name="repositoryType">in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling.</param>
		/// <exception cref="ArgumentNullException"><paramref name="assembly" /> is <see langword="null" />.</exception>
		private void GetInfoForAssembly(Assembly assembly, ref string repositoryName, ref Type repositoryType)
		{
			if (assembly == null)
			{
				throw new ArgumentNullException("assembly");
			}

			try
			{
				LogLog.Debug("DefaultRepositorySelector: Assembly [" + assembly.FullName + "] Loaded From [" + SystemInfo.AssemblyLocationInfo(assembly) + "]");
			}
			catch
			{
				// Ignore exception from debug call
			}

			try
			{
				// Look for the RepositoryAttribute on the assembly 
				object[] repositoryAttributes = Attribute.GetCustomAttributes(assembly, typeof(log4net.Config.RepositoryAttribute), false);
				if (repositoryAttributes == null || repositoryAttributes.Length == 0)
				{
					// This is not a problem, but its nice to know what is going on.
					LogLog.Debug("DefaultRepositorySelector: Assembly [" + assembly + "] does not have a RepositoryAttribute specified.");
				}
				else
				{
					if (repositoryAttributes.Length > 1)
					{
						LogLog.Error("DefaultRepositorySelector: Assembly [" + assembly + "] has multiple log4net.Config.RepositoryAttribute assembly attributes. Only using first occurrence.");
					}

					log4net.Config.RepositoryAttribute domAttr = repositoryAttributes[0] as log4net.Config.RepositoryAttribute;

					if (domAttr == null)
					{
						LogLog.Error("DefaultRepositorySelector: Assembly [" + assembly + "] has a RepositoryAttribute but it does not!.");
					}
					else
					{
						// If the Name property is set then override the default
						if (domAttr.Name != null)
						{
							repositoryName = domAttr.Name;
						}

						// If the RepositoryType property is set then override the default
						if (domAttr.RepositoryType != null)
						{
							// Check that the type is a repository
							if (typeof(ILoggerRepository).IsAssignableFrom(domAttr.RepositoryType))
							{
								repositoryType = domAttr.RepositoryType;
							}
							else
							{
								LogLog.Error("DefaultRepositorySelector: Repository Type [" + domAttr.RepositoryType + "] must implement the ILoggerRepository interface.");
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				LogLog.Error("DefaultRepositorySelector: Unhandled exception in GetInfoForAssembly", ex);
			}
		}

		/// <summary>
		/// Configures the repository using information from the assembly.
		/// </summary>
		/// <param name="assembly">The assembly containing <see cref="log4net.Config.ConfiguratorAttribute"/>
		/// attributes which define the configuration for the repository.</param>
		/// <param name="repository">The repository to configure.</param>
		/// <exception cref="ArgumentNullException">
		///	<para><paramref name="assembly" /> is <see langword="null" />.</para>
		///	<para>-or-</para>
		///	<para><paramref name="repository" /> is <see langword="null" />.</para>
		/// </exception>
		private void ConfigureRepository(Assembly assembly, ILoggerRepository repository)
		{
			if (assembly == null)
			{
				throw new ArgumentNullException("assembly");
			}
			if (repository == null)
			{
				throw new ArgumentNullException("repository");
			}

			// Look for the Configurator attributes (e.g. XmlConfiguratorAttribute) on the assembly
			object[] configAttributes = Attribute.GetCustomAttributes(assembly, typeof(log4net.Config.ConfiguratorAttribute), false);
			if (configAttributes != null && configAttributes.Length > 0)
			{
				// Sort the ConfiguratorAttributes in priority order
				Array.Sort(configAttributes);

				// Delegate to the attribute the job of configuring the repository
				foreach(log4net.Config.ConfiguratorAttribute configAttr in configAttributes)
				{
					if (configAttr != null)
					{
						try
						{
							configAttr.Configure(assembly, repository);
						}
						catch (Exception ex)
						{
							LogLog.Error("DefaultRepositorySelector: Exception calling ["+configAttr.GetType().FullName+"] .Configure method.", ex);
						}
					}
				}
			}

			if (repository.Name == DefaultRepositoryName)
			{
				// Try to configure the default repository using an AppSettings specified config file
				// Do this even if the repository has been configured (or claims to be), this allows overriding
				// of the default config files etc, if that is required.

				string repositoryConfigFile = SystemInfo.GetAppSetting("log4net.Config");
				if (repositoryConfigFile != null && repositoryConfigFile.Length > 0)
				{
					string applicationBaseDirectory = null;
					try
					{
						applicationBaseDirectory = SystemInfo.ApplicationBaseDirectory;
					}
					catch(Exception ex)
					{
						LogLog.Warn("DefaultRepositorySelector: Exception getting ApplicationBaseDirectory. appSettings log4net.Config path ["+repositoryConfigFile+"] will be treated as an absolute URI", ex);
					}

					// As we are not going to watch the config file it is easiest to just resolve it as a 
					// URI and pass that to the Configurator
					Uri repositoryConfigUri = null;
					try
					{
						if (applicationBaseDirectory != null)
						{
							// Resolve the config path relative to the application base directory URI
							repositoryConfigUri = new Uri(new Uri(applicationBaseDirectory), repositoryConfigFile);
						}
						else
						{
							repositoryConfigUri = new Uri(repositoryConfigFile);
						}
					}
					catch(Exception ex)
					{
						LogLog.Error("DefaultRepositorySelector: Exception while parsing log4net.Config file path ["+repositoryConfigFile+"]", ex);
					}

					if (repositoryConfigUri != null)
					{
						LogLog.Debug("DefaultRepositorySelector: Loading configuration for default repository from AppSettings specified Config URI ["+repositoryConfigUri.ToString()+"]");

						try
						{
							// TODO: Support other types of configurator
							XmlConfigurator.Configure(repository, repositoryConfigUri);
						}
						catch (Exception ex)
						{
							LogLog.Error("DefaultRepositorySelector: Exception calling XmlConfigurator.Configure method with ConfigUri ["+repositoryConfigUri+"]", ex);
						}
					}
				}
			}
		}

		/// <summary>
		/// Loads the attribute defined plugins on the assembly.
		/// </summary>
		/// <param name="assembly">The assembly that contains the attributes.</param>
		/// <param name="repository">The repository to add the plugins to.</param>
		/// <exception cref="ArgumentNullException">
		///	<para><paramref name="assembly" /> is <see langword="null" />.</para>
		///	<para>-or-</para>
		///	<para><paramref name="repository" /> is <see langword="null" />.</para>
		/// </exception>
		private void LoadPlugins(Assembly assembly, ILoggerRepository repository)
		{
			if (assembly == null)
			{
				throw new ArgumentNullException("assembly");
			}
			if (repository == null)
			{
				throw new ArgumentNullException("repository");
			}

			// Look for the PluginAttribute on the assembly
			object[] configAttributes = Attribute.GetCustomAttributes(assembly, typeof(log4net.Config.PluginAttribute), false);
			if (configAttributes != null && configAttributes.Length > 0)
			{
				foreach(log4net.Plugin.IPluginFactory configAttr in configAttributes)
				{
					try
					{
						// Create the plugin and add it to the repository
						repository.PluginMap.Add(configAttr.CreatePlugin());
					}
					catch(Exception ex)
					{
						LogLog.Error("DefaultRepositorySelector: Failed to create plugin. Attribute [" + configAttr.ToString() + "]", ex);
					}
				}
			}
		}

		/// <summary>
		/// Loads the attribute defined aliases on the assembly.
		/// </summary>
		/// <param name="assembly">The assembly that contains the attributes.</param>
		/// <param name="repository">The repository to alias to.</param>
		/// <exception cref="ArgumentNullException">
		///	<para><paramref name="assembly" /> is <see langword="null" />.</para>
		///	<para>-or-</para>
		///	<para><paramref name="repository" /> is <see langword="null" />.</para>
		/// </exception>
		private void LoadAliases(Assembly assembly, ILoggerRepository repository)
		{
			if (assembly == null)
			{
				throw new ArgumentNullException("assembly");
			}
			if (repository == null)
			{
				throw new ArgumentNullException("repository");
			}

			// Look for the AliasRepositoryAttribute on the assembly
			object[] configAttributes = Attribute.GetCustomAttributes(assembly, typeof(log4net.Config.AliasRepositoryAttribute), false);
			if (configAttributes != null && configAttributes.Length > 0)
			{
				foreach(log4net.Config.AliasRepositoryAttribute configAttr in configAttributes)
				{
					try
					{
						AliasRepository(configAttr.Name, repository);
					}
					catch(Exception ex)
					{
						LogLog.Error("DefaultRepositorySelector: Failed to alias repository [" + configAttr.Name + "]", ex);
					}
				}
			}
		}

		#endregion Private Instance Methods

		#region Private Static Fields

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

		#endregion Private Static Fields

		#region Private Instance Fields

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

		private event LoggerRepositoryCreationEventHandler m_loggerRepositoryCreatedEvent;

		#endregion Private Instance Fields
	}
}

#endif // !NETCF

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av在线这里只有精品| 日韩va欧美va亚洲va久久| 国产午夜亚洲精品午夜鲁丝片| 精品国精品国产尤物美女| 欧美不卡视频一区| 久久久久久久久蜜桃| 国产精品久久久久影院| 亚洲欧美福利一区二区| 天涯成人国产亚洲精品一区av| 蜜桃久久久久久| 国产福利一区二区三区视频在线| 国产成人日日夜夜| 欧美伊人精品成人久久综合97| 欧美精品黑人性xxxx| 久久伊人蜜桃av一区二区| 中日韩免费视频中文字幕| 亚洲综合网站在线观看| 国产一区不卡在线| 欧美日韩一区二区三区高清| 精品日韩一区二区三区免费视频| 国产欧美日韩久久| 日韩av一级电影| 91精彩视频在线观看| 欧美精品一区二区三区蜜桃 | 亚洲一区二区三区三| 看电影不卡的网站| 欧美猛男gaygay网站| 专区另类欧美日韩| 国产美女一区二区三区| 9191成人精品久久| 亚洲成人av中文| 在线观看日韩一区| 亚洲狼人国产精品| 成人免费视频caoporn| 国产午夜精品久久久久久免费视 | 99在线视频精品| 国产女人18毛片水真多成人如厕| 九色porny丨国产精品| 日韩午夜三级在线| 另类小说视频一区二区| 7777精品伊人久久久大香线蕉完整版 | 久久综合九色欧美综合狠狠| 日本vs亚洲vs韩国一区三区二区 | 成人18视频在线播放| 国产精品色婷婷| 91免费小视频| 奇米一区二区三区av| 精品女同一区二区| 成人高清av在线| 日韩午夜av电影| 欧美一区二区三区在线视频| 欧美精品少妇一区二区三区| 一区二区三区国产精华| 7777精品伊人久久久大香线蕉超级流畅| 婷婷中文字幕综合| 国产欧美日韩卡一| 91精品国产日韩91久久久久久| 国产乱人伦精品一区二区在线观看 | 欧美一区二区日韩| 成人午夜精品在线| 婷婷国产在线综合| 亚洲综合一二区| 国产精品国产三级国产有无不卡| 精品国产第一区二区三区观看体验 | 精品1区2区3区| 成人免费视频视频| 国产一区二区视频在线| 五月综合激情网| 亚洲裸体在线观看| 综合精品久久久| 亚洲国产精品成人综合色在线婷婷| 91精品国产入口在线| 欧美视频一区二区三区四区| 色婷婷综合激情| 色狠狠av一区二区三区| 色屁屁一区二区| 日本精品视频一区二区| 欧洲激情一区二区| 欧美午夜免费电影| 欧美伦理视频网站| 欧美一级理论性理论a| 欧美日韩激情一区| 日韩一区二区三区四区| 日韩欧美123| 国产日韩视频一区二区三区| 精品少妇一区二区三区日产乱码| 日韩欧美在线综合网| 精品sm捆绑视频| 国产欧美日韩视频一区二区 | 99亚偷拍自图区亚洲| 久久精品国产99| 福利一区福利二区| 91美女视频网站| 欧美精品久久99| 国产日产精品1区| 亚洲香蕉伊在人在线观| 青青草精品视频| 国产成人av一区二区三区在线 | 色婷婷综合久久久中文一区二区| 91九色02白丝porn| 精品国产成人系列| 日本中文字幕一区| 亚洲人快播电影网| 日韩在线观看一区二区| 国产一区二区91| 欧美日韩一级视频| 久久精品视频在线免费观看| 亚洲综合久久久久| 国产91富婆露脸刺激对白| 555www色欧美视频| 亚洲人成精品久久久久| 精品一区二区三区视频| 91福利社在线观看| 国产精品理论片在线观看| 狠狠色狠狠色综合日日91app| 91福利社在线观看| 亚洲美女电影在线| 一本到一区二区三区| 日韩伦理免费电影| 奇米亚洲午夜久久精品| 欧美日韩亚洲丝袜制服| 一区二区三区视频在线看| 9l国产精品久久久久麻豆| 国产午夜精品久久久久久久| 六月丁香婷婷色狠狠久久| 欧美日韩国产综合一区二区| 亚洲sss视频在线视频| 欧美日韩亚洲综合| 日韩高清在线不卡| 欧美一区二区三区免费视频| 日本亚洲电影天堂| 亚洲综合999| 欧美群妇大交群中文字幕| 亚洲电影激情视频网站| 日韩欧美一区二区免费| 精品在线播放免费| 亚洲国产精品成人综合色在线婷婷| 懂色av中文一区二区三区| 欧美国产一区二区| 欧美亚洲国产bt| 国产一区二区精品久久99| 中文字幕av一区二区三区高| 99国产精品久久久久| 丝袜亚洲另类欧美| 国产精品天美传媒| 欧美日产在线观看| 国产91精品精华液一区二区三区| 亚洲一区日韩精品中文字幕| 日韩一区二区三区免费看| 成人免费观看视频| 蜜桃视频在线观看一区| 国产精品视频看| 久久久久久一二三区| 欧美在线一二三四区| 风间由美一区二区av101| 五月天激情小说综合| 国产精品剧情在线亚洲| 日韩欧美一区电影| 7777精品久久久大香线蕉| 99九九99九九九视频精品| 国产自产高清不卡| 六月丁香综合在线视频| 热久久久久久久| av激情成人网| 成人h精品动漫一区二区三区| 美国十次综合导航| 六月婷婷色综合| 免费成人在线网站| 美女在线一区二区| 久久99国产精品尤物| 男人的j进女人的j一区| 日韩va亚洲va欧美va久久| 亚州成人在线电影| 91视频免费观看| 99久久99久久精品国产片果冻 | 成人精品一区二区三区中文字幕| 久久精品国产77777蜜臀| 国产一区二三区好的| 成人性生交大片免费看在线播放| 国产麻豆9l精品三级站| 国产91在线观看丝袜| 99精品黄色片免费大全| 在线观看亚洲一区| 日韩欧美中文字幕精品| 国产日产精品一区| 亚洲午夜久久久久久久久电影院 | 中文字幕乱码久久午夜不卡| 国产精品国产a| 日本不卡视频在线| www.成人在线| 91麻豆精品91久久久久久清纯| 日韩女优视频免费观看| 亚洲国产精品成人久久综合一区| 亚洲免费观看高清完整| 青青草国产成人av片免费| 成人黄色在线视频| 日韩视频免费观看高清完整版 | 欧美日韩一区二区在线观看视频| 欧美一区日韩一区| 亚洲一区二区影院|