Ejemplo n.º 1
0
        /// <summary>
        /// Creates a dynamic dictionary from an <see cref="IDictionary{TKey,TValue}"/> instance.
        /// </summary>
        /// <param name="values">An <see cref="IDictionary{TKey,TValue}"/> instance, that the dynamic dictionary should be created from.</param>
        /// <param name="globalizationConfiguration"></param>
        /// <returns>An <see cref="DynamicDictionary"/> instance.</returns>
        public static DynamicDictionary Create(IDictionary <string, object> values, GlobalizationConfiguration globalizationConfiguration)
        {
            var instance = new DynamicDictionary(globalizationConfiguration);

            foreach (var key in values.Keys)
            {
                instance[key] = values[key];
            }

            return(instance);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicDictionaryValue"/> class, with
 /// the provided <paramref name="value"/> and <paramref name="globalizationConfiguration"/>.
 /// </summary>
 /// <param name="value">The value to store in the instance</param>
 /// <param name="globalizationConfiguration">A <see cref="GlobalizationConfiguration"/> instance.</param>
 public DynamicDictionaryValue(object value, GlobalizationConfiguration globalizationConfiguration)
 {
     this.value = value;
     this.globalizationConfiguration = globalizationConfiguration;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new istance of the <see cref="DynamicDictionary"/> class.
 /// </summary>
 /// <param name="globalizationConfiguration">A <see cref="GlobalizationConfiguration"/> instance.</param>
 public DynamicDictionary(GlobalizationConfiguration globalizationConfiguration)
 {
     this.globalizationConfiguration = globalizationConfiguration;
 }