static Reflection() { var providerName = "Reflection"; var rps = ProviderConfiguration.GetProvider(Path("App_Data\\UMC\\assembly.xml")); if (rps != null) { if (rps == null || rps.Providers.Contains(providerName) == false) { instance = new Reflection(); instance.Provider = Provider.Create(providerName, typeof(Reflection).FullName); } else { instance = CreateObject(rps, providerName) as Reflection; if (instance == null) { instance = new Reflection(); instance.Provider = rps[providerName]; } } } else { instance = new Reflection(); instance.Provider = Provider.Create(providerName, typeof(Reflection).FullName); } }
/// <summary> /// 获取平台配置 /// </summary> /// <param name="configKey">配置名</param> /// <returns></returns> public static ProviderConfiguration Configuration(string configKey) { var path = AppDataPath(String.Format("UMC\\{0}.xml", configKey)); if (System.IO.File.Exists(path)) { return(ProviderConfiguration.GetProvider(path)); } return(null); }
static Reflection() { var path = AppDataPath(String.Format("WebADNuke\\assembly.config")); if (System.IO.File.Exists(path)) { var rps = ProviderConfiguration.GetProvider(path); var providerName = "Reflection"; if (rps == null || rps.Providers.Contains(providerName) == false) { reflection = new Reflection(); } else { reflection = CreateObject(rps, providerName) as Reflection; } } else { reflection = new Reflection(); } }