您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->IFNuke1.1.0版源码>>Core/ProviderConfiguration.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:IFNuke1.1.0版源码
当前文件:文件类型 IFnuke110/Core/ProviderConfiguration.cs打开代码结构图
普通视图
		            
1using System; 2using System.IO; 3using System.Collections; 4using System.Collections.Specialized; 5using System.Configuration; 6using System.Xml; 7 8namespace IFNuke 9{ 10 public class ProviderConfiguration 11 { 12 private string _defaultProvider; 13 private Hashtable _providers = new Hashtable(); 14 15 public string DefaultProvider 16 { 17 get { return _defaultProvider; } 18 } 19 public Hashtable Providers 20 { 21 get { return _providers; } 22 } 23 24 public static ProviderConfiguration GetProviderConfiguration(string providerConfigurationSection) 25 { 26 XmlNode node = Config.GetProviderConfigurationSection(providerConfigurationSection); 27 ProviderConfiguration pc = new ProviderConfiguration(); 28 pc.LoadValuesFromConfigurationXml(node); 29 return pc; 30 } 31 32 private void LoadValuesFromConfigurationXml(XmlNode node) 33 { 34 XmlAttributeCollection attributes = node.Attributes; 35 _defaultProvider = attributes["defaultProvider"].Value; 36 37 // Read child nodes 38 foreach (XmlNode child in node.ChildNodes) 39 { 40 if (child.Name == "providers") 41 GetProviders(child); 42 } 43 } 44 45 private void GetProviders(XmlNode node) 46 { 47 foreach (XmlNode childNode in node.ChildNodes) 48 { 49 switch (childNode.Name) 50 { 51 case "add": 52 _providers.Add(childNode.Attributes["name"].Value, new Provider(childNode.Attributes)); 53 break; 54 case "remove": 55 _providers.Remove(childNode.Attributes["name"].Value); 56 break; 57 case "clear": 58 _providers.Clear(); 59 break; 60 } 61 } 62 } 63 } 64 65}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:IFNuke1.1.0版源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号