コード例 #1
0
        public static RemoteServiceConfiguration SetUseCurrentAccessToken([NotNull] this RemoteServiceConfiguration configuration, [CanBeNull] bool?value)
        {
            if (value == null)
            {
                configuration.Remove(UseCurrentAccessTokenName);
            }
            else
            {
                configuration[UseCurrentAccessTokenName] = value.Value.ToString().ToLowerInvariant();
            }

            return(configuration);
        }
コード例 #2
0
        public static bool?GetUseCurrentAccessToken([NotNull] this RemoteServiceConfiguration configuration)
        {
            Check.NotNullOrEmpty(configuration, nameof(configuration));

            var value = configuration.GetOrDefault(UseCurrentAccessTokenName);

            if (value == null)
            {
                return(null);
            }

            return(bool.Parse(value));
        }
コード例 #3
0
 public static RemoteServiceConfiguration SetIdentityClient([NotNull] this RemoteServiceConfiguration configuration, [CanBeNull] string value)
 {
     configuration[IdentityClientName] = value;
     return(configuration);
 }
コード例 #4
0
        public static string GetIdentityClient([NotNull] this RemoteServiceConfiguration configuration)
        {
            Check.NotNullOrEmpty(configuration, nameof(configuration));

            return(configuration.GetOrDefault(IdentityClientName));
        }