Beispiel #1
0
        /// <summary>
        /// Gets or sets the <see cref="DynamicDictionaryValue"/> with the specified name.
        /// </summary>
        /// <value>A <see cref="DynamicDictionaryValue"/> instance containing a value.</value>
        public dynamic this[string name]
        {
            get
            {
                dynamic member;
                if (!dictionary.TryGetValue(name, out member))
                {
                    member = new DynamicDictionaryValue(null);
                }

                return(member);
            }
            set { dictionary[name] = value is DynamicDictionaryValue ? value : new DynamicDictionaryValue(value); }
        }
Beispiel #2
0
        /// <summary>
        /// Gets or sets the <see cref="DynamicDictionaryValue"/> with the specified name.
        /// </summary>
        /// <value>A <see cref="DynamicDictionaryValue"/> instance containing a value.</value>
        public dynamic this[string name]
        {
            get
            {
                name = GetNeutralKey(name);

                dynamic member;
                if (!dictionary.TryGetValue(name, out member))
                {
                    member = new DynamicDictionaryValue(null, this.globalizationConfiguration);
                }

                return(member);
            }
            set
            {
                name = GetNeutralKey(name);

                dictionary[name] = value is DynamicDictionaryValue ? value : new DynamicDictionaryValue(value, this.globalizationConfiguration);
            }
        }