protected override object OnExecute(CommandContext context) { var configuration = ConfigurationCommand.GetConfiguration(context.CommandNode); if (configuration == null) { throw new CommandException(string.Format(Properties.Resources.Text_CannotObtainCommandTarget, "Configuration")); } if (context.Expression.Arguments.Length == 0) { throw new CommandException(Properties.Resources.Text_Command_MissingArguments); } if (context.Expression.Arguments.Length == 1) { var section = configuration.GetSection(context.Expression.Arguments[0]); ConfigurationCommand.Print(section, context.Output, 0); return(section); } var sections = new Microsoft.Extensions.Configuration.IConfigurationSection[context.Expression.Arguments.Length]; for (int i = 0; i < context.Expression.Arguments.Length; i++) { sections[i] = configuration.GetSection(context.Expression.Arguments[i]); ConfigurationCommand.Print(sections[i], context.Output, 0); } return(sections); }
public LogifyAlertMiddleware(RequestDelegate next, Microsoft.Extensions.Configuration.IConfigurationSection config) { this.next = next; if (config != null) { LogifyAlert.Instance.Configure(config); } }
/// <summary> /// Configure the IRestApiClient using app config values. /// </summary> /// <summary> /// Configure the IRestApiClient using a configuration section. /// </summary> public ApiClientBuilder ConfigureFromConfigSection(Microsoft.Extensions.Configuration.IConfigurationSection configurationSection) { foreach (var subSection in configurationSection.GetSection("Apis").GetChildren()) { ConfigureContractKey(subSection.Key, new SectionConfigReader(configurationSection, subSection)); } return(this); }
private static List <IEnvelope <JObject> > ParseRecords(StreamReader sr, Microsoft.Extensions.Configuration.IConfigurationSection config) { string timetampFormat = config["TimestampFormat"]; string timestampField = config["TimestampField"]; var parser = new SingleLineJsonParser(timestampField, timetampFormat, NullLogger.Instance); var records = parser.ParseRecords(sr, new DelimitedLogContext()).ToList(); return(records); }
/// <summary> /// Reads the security text from configuration. /// </summary> /// <param name="section">The section containing the key/value pairs.</param> public SecurityTextBuilder ReadFromConfiguration(Microsoft.Extensions.Configuration.IConfigurationSection section) { foreach (var subKey in section.GetChildren()) { switch (subKey.Key.ToLower()) { case "contact": SetContact(subKey.Value); break; case "encryption": SetEncryption(subKey.Value); break; case "signature": SetSignature(subKey.Value); break; case "policy": SetPolicy(subKey.Value); break; case "acknowledgments": SetAcknowledgments(subKey.Value); break; case "hiring": SetHiring(subKey.Value); break; case "introduction": SetIntroduction(subKey.Value); break; case "validatevalues": SetValidateValues(bool.Parse(subKey.Value)); break; case "permission": SetPermission(subKey.Value); break; default: break; } } return(this); }
public static bool Exists(this Microsoft.Extensions.Configuration.IConfigurationSection section) { throw null; }
private static List <IEnvelope <DelimitedLogRecord> > ParseRecords(StreamReader sr, Microsoft.Extensions.Configuration.IConfigurationSection config) { string timetampFormat = config["TimestampFormat"]; var parser = DirectorySourceFactory.CreateDelimitedLogParser(new PluginContext(config, null, null, new BookmarkManager()), timetampFormat, DateTimeKind.Utc); var records = parser.ParseRecords(sr, new DelimitedLogContext()).ToList(); return(records); }
public Task InitializeAsync(IServiceProvider provider, Microsoft.Extensions.Configuration.IConfigurationSection conf) => ResolveBackendAsync(provider);
public ConfigurationSectionWrapper(Microsoft.Extensions.Configuration.IConfigurationSection section) { _section = section; }
public static IApplicationBuilder UseLogifyAlert(this IApplicationBuilder builder, Microsoft.Extensions.Configuration.IConfigurationSection config) { return(builder.UseMiddleware <LogifyAlertMiddleware>(config)); }
public async Task InitializeAsync(IServiceProvider provider, Microsoft.Extensions.Configuration.IConfigurationSection config) { Deserialize(await Utilities.ReadAllTextAsync(config["source"]).ConfigureAwait(false)); }