学习asp.net......

你有个苹果我有苹果大家互换还是一个苹果,你有个思想,我有个思想大家互换就有两个...

这段程序谁能看的懂啊?

using System;
using System.Xml.Serialization;
using System.Configuration;

namespace Bzfc.Components
{
 /// <summary>
 /// Globals 的摘要说明。
 /// </summary>
 ///

 public class Globals
 {
  public Globals()
  {
   //
   // TODO: 在此处添加构造函数逻辑
   //
  }
  public static IDTOProvider DbProvider
  {
   get
   {
    return DTOProvider.Instance();
   }
  }

 }

 //返回DTOProviderConfiguration.Instance()
 public class DTOProvider
 {
  private DTOProvider(){}
  
  static DTOProvider()
  {
   DTOProviderConfiguration dtoPC = Config.Settings.WebProviders.DTOProvider;
   idto = (IDTOProvider)dtoPC.Instance();
  }
  private static IDTOProvider idto = null;
  public static IDTOProvider Instance()
  {
   return idto;
  }
 }

 

 public class DbProvider
 {
  private DbProvider()
  {
  }
  static DbProvider()
  {
   DbProviderConfiguration dpc = Config.Settings.WebProviders.DbProvider;
   dp = (IDbProvider)dpc.Instance();
  
  }
  private static IDbProvider dp = null;
  public static IDbProvider Instance()
  {
   return dp;
  }
 }


 public class DataDTOProvider : IDTOProvider
 {
  public bool AddUser()
  {
   return DbProvider.Instance().AddUser();
  }
 
 }

 

 

/// <summary>
///    Config.Setting = WebConfigurationSettings.Instance();
/// </summary>
 public class Config
 {
  
  public Config()
  {
  }
  public static WebConfigurationSettings Settings
  {
   get
   {
    return WebConfigurationSettings.Instance();
   }
  }
 }


 /// <summary>
 /// WebConfigurationSettings.Instance();
 /// </summary>
 [Serializable]
 public class WebConfigurationSettings
 {
  public WebConfigurationSettings()
  {
  }
  public static WebConfigurationSettings Instance()
  {
   return ((WebConfigurationSettings)ConfigurationSettings.GetConfig("WebConfigurationSettings"));
  }
  private WebProviders _webProviders;
  public WebProviders WebProviders
  {
   get {return this._webProviders;}
   set {this._webProviders = value;}
  }
 }
 [XmlRoot("DTOProvider")]
 public class DTOProviderConfiguration : BaseProvider
 {
  public DTOProviderConfiguration()
  {
   //
   // TODO: Add constructor logic here
   //
  }
 }

 

 public abstract class BaseProvider
 {
  public BaseProvider()
  {
   //
   // TODO: Add constructor logic here
   //
  }

  //public abstract object Instance();

  private string _type;

  [XmlAttribute("type")]
  public string ProviderType
  {
   get { return _type; }
   set { _type = value; }
  }

  public object Instance()
  {
   return Activator.CreateInstance(System.Type.GetType(this.ProviderType));
  }
 }

 /// <summary>
 /// DTOProvider
 /// </summary>
 public class WebProviders
 {
  public WebProviders()
  {

  }
  private DTOProviderConfiguration _dTOProvider;
  public DTOProviderConfiguration DTOProvider
  {
   get {return this._dTOProvider;}
   set {this._dTOProvider = value;}
  }
  private DbProviderConfiguration _dbProvider;
  public DbProviderConfiguration DbProvider
  {
   get {return this._dbProvider;}
   set {this._dbProvider = value;}
  }
 }

 

 [XmlRoot("DbProvider")]
 public class DbProviderConfiguration : BaseProvider
 {
  public DbProviderConfiguration()
  {
  }

  private string _connectionString;
  [XmlAttribute("connectionString")]
  public string ConnectionString
  {
   get {return this._connectionString;}
   set {this._connectionString = value;}
  }

 }

}

阅读更多
个人分类: Asp.net
想对作者说点什么? 我来说一句

计算机密码学 凯撒密码加密算法

2009年06月29日 1.79MB 下载

DirectX-9

2007年07月25日 3.15MB 下载

没有更多推荐了,返回首页

不良信息举报

这段程序谁能看的懂啊?

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭