BlogEngine.Core/Providers/BlogService.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#region Using

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Configuration.Provider;
using System.Web.Configuration;
using System.Web;
using System.IO;
using BlogEngine.Core;
using BlogEngine.Core.DataStore;

#endregion

namespace BlogEngine.Core.Providers
{
	/// <summary>
	/// The proxy class for communication between
	/// the business objects and the providers.
	/// </summary>
	public static class BlogService
	{

		#region Provider model

		private static BlogProvider _provider;
		private static BlogProviderCollection _providers;
		private static object _lock = new object();

		/// <summary>
		/// Gets the current provider.
		/// </summary>
		public static BlogProvider Provider
		{
			get { LoadProviders(); return _provider; }
		}

		/// <summary>
		/// Gets a collection of all registered providers.
		/// </summary>
		public static BlogProviderCollection Providers
		{
			get { LoadProviders(); return _providers; }
		}

		/// <summary>
		/// Load the providers from the web.config.
		/// </summary>
		private static void LoadProviders()
		{
			// Avoid claiming lock if providers are already loaded
			if (_provider == null)
			{
				lock (_lock)
				{
					// Do this again to make sure _provider is still null
					if (_provider == null)
					{
						// Get a reference to the <blogProvider> section
后面还有 334 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。