private void InitializeFromKeyValueManager()

in src/Microsoft.Azure.NotificationHubs/NotificationHubConnectionStringBuilder.cs [70:101]


        private void InitializeFromKeyValueManager(KeyValueConfigurationManager kvmManager)
        {
            try
            {
                // we should avoid caching KeyValueCofigurationManager because it internally
                // cache the connection string which might contain password information.
                kvmManager.Validate();

                // Endpoint
                var endpoint = kvmManager.connectionProperties[KeyValueConfigurationManager.EndpointConfigName];
                if(!string.IsNullOrEmpty(endpoint))
                {
                    this.Endpoint = new Uri(endpoint);
                }

                var sasKeyName = kvmManager.connectionProperties[KeyValueConfigurationManager.SharedAccessKeyName];
                if (!string.IsNullOrWhiteSpace(sasKeyName))
                {
                    this.SharedAccessKeyName = sasKeyName;
                }

                var sasValue = kvmManager.connectionProperties[KeyValueConfigurationManager.SharedAccessValueName];
                if (!string.IsNullOrWhiteSpace(sasValue))
                {
                    this.SharedAccessKey = sasValue;
                }
            }
            catch (Exception exception)
            {
                throw new ArgumentException(exception.Message, "connectionString", exception);
            }
        }