private void ParseDocument() { ConfigurationSystem OConfigurationSystem = new ConfigurationSystem(FProjectRoot); FileInfo OFileInfo = new FileInfo(FFilename).GetCorrectlyCasedFileInfo(); FItemName = OFileInfo.GetNameWithoutExt(); XElement ORoot = FDocument.Element(XmlNamespace + "items"); Configuration OConfiguration = OConfigurationSystem.GetConfigurationFor(OFileInfo.DirectoryName); FConfiguration = OConfiguration; if (ORoot.Element(XmlNamespace + "configuration") != null) { FConfiguration = new Configuration(ORoot.Element(XmlNamespace + "configuration"), XmlNamespace); if (OConfiguration != null) { OConfiguration.Append(FConfiguration); FConfiguration = OConfiguration; } } foreach (XElement OViewItem in ORoot.Elements(XmlNamespace + "viewitem")) { FViewItems.Add(new ViewItem(this, FConfiguration, OViewItem)); } foreach (XElement OScalarItem in ORoot.Elements(XmlNamespace + "scalar")) { FScalarItems.Add(new ScalarItem(this, FConfiguration, OScalarItem)); } foreach (XElement OVoidItem in ORoot.Elements(XmlNamespace + "void")) { FVoidItems.Add(new VoidItem(this, FConfiguration, OVoidItem)); } }
private void InitConfiguration() { ConfigurationSystem OConfigurationSystem = new ConfigurationSystem(FProjectRoot); Configuration OConfiguration = OConfigurationSystem.GetConfigurationFor(FProjectRoot); FConfiguration = OConfiguration; }
public void OnApplicationStart(IIocContainer container, object context) { if (container.IsRegistered <IEnumerable <IConfigurationProvider> >()) { ConfigurationSystem.Install(container.Resolve <IEnumerable <IConfigurationProvider> >()); } }
public static object GetSection(string sectionName) { var o = ConfigurationSystem.GetSection(sectionName); if (o is ConfigurationSection) { return(((ConfigurationSection)o).GetRuntimeObject()); } return(o); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var key = Encoding.ASCII.GetBytes(Configuration.GetValue <string>("Settings:Secret")); var ConfigurateJwt = new ConfigurationSystem(services); services.AddSingleton(Configuration); services.AddCors(); services.AddControllers(); ConfigurateJwt.ConfigurinJwt(key); }
public static void RefreshSection(string sectionName) { ConfigurationSystem.RefreshConfig(sectionName); }