Пример #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[IdentityClient] = value;
     return(configuration);
 }
Пример #4
0
        public static string GetIdentityClient([NotNull] this RemoteServiceConfiguration configuration)
        {
            Check.NotNullOrEmpty(configuration, nameof(configuration));

            return(configuration.GetOrDefault(IdentityClient));
        }