示例#1
0
        private static IDictionary <string, string> create_dictionary_from_configuration(ConfigurationPropertyHolder configuration)
        {
            Dictionary <string, string> property_dictionary = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            foreach (var property in configuration.GetType().GetProperties())
            {
                if (property.Name == "UserTokens")
                {
                    var user_tokens = property.GetValue(configuration, null) as Dictionary <string, string>;
                    if (user_tokens == null)
                    {
                        continue;
                    }

                    foreach (var user_token in user_tokens)
                    {
                        property_dictionary[user_token.Key] = user_token.Value;
                    }
                }
                else
                {
                    property_dictionary.Add(property.Name, property.GetValue(configuration, null).to_string());
                }
            }

            return(property_dictionary);
        }
示例#2
0
        private static IDictionary<string, string> create_dictionary_from_configuration(ConfigurationPropertyHolder configuration)
        {
            Dictionary<string, string> property_dictionary = new Dictionary<string, string>();
            foreach (var property in configuration.GetType().GetProperties())
            {
                property_dictionary.Add(property.Name.to_lower(), property.GetValue(configuration, null).to_string());
            }

            return property_dictionary;
        }
示例#3
0
        private static IDictionary <string, string> create_dictionary_from_configuration(ConfigurationPropertyHolder configuration)
        {
            Dictionary <string, string> property_dictionary = new Dictionary <string, string>();

            foreach (var property in configuration.GetType().GetProperties())
            {
                property_dictionary.Add(property.Name.to_lower(), property.GetValue(configuration, null).to_string());
            }

            return(property_dictionary);
        }