public static string GetString(this IKeyValueReader @this, string key) { var task = Task.Run(async() => await @this.GetStringAsync(key).ConfigureAwait(false)); Task.WaitAll(task); return(task.Result); }
public static T GetObject <T>(this IKeyValueReader @this, string key) where T : class, new() { var task = Task.Run(async() => await @this.GetObjectAsync <T>(key).ConfigureAwait(false)); Task.WaitAll(task); return(task.Result); }
public static int?GetInt32(this IKeyValueReader @this, string key) { var task = Task.Run(async() => await GetInt32Async(@this, key).ConfigureAwait(false)); Task.WaitAll(task); return(task.Result); }
public Settings(IKeyValueReader keyValueReader) { _keyValueReader = keyValueReader; //set some reasonable (usually) functional defaults for the optional app.config values GoogleCodeProjectUrl = string.Format("https://code.google.com/p/{0}", GoogleCodeProjectName); GoogleCodeIssueUrlStringFormatTemplate = string.Format("{0}/issues/detail?id={{0}}", GoogleCodeProjectUrl); GitHubApiThrottleOnCreateInvocationCount = 20; GitHubApiThrottleOnCreatePauseDurationMilliseconds = 70000; GitHubApiProductHeaderValue = "google%20code%20to%20github%20issue%20migrator"; }
public static async Task <int?> GetInt32Async(this IKeyValueReader @this, string key, CancellationToken cancellationToken = default) { var decimalValue = await @this.GetDecimalAsync(key, cancellationToken); return((int?)decimalValue); }
public static Key ReadKey(this IKeyValueConverterFactory factory, Key key) { IKeyValueReader reader = factory.GetValueReader(key); return(reader.ReadValue(key)); }