/// <summary> /// Evaluates whether or not this and the given MultiTypeDictionary are equal in value. /// </summary> /// /// <param name="value">The value to compare.</c> /// /// <returns>Whether or not they are equal.</returns> public bool Equals(MultiTypeDictionary value) { if ((object)value == null) { return(false); } if (object.ReferenceEquals(this, value)) { return(true); } if (Count != value.Count) { return(false); } foreach (var entry in this) { if (!value.ContainsKey(entry.Key)) { return(false); } if (value[entry.Key] != entry.Value) { return(false); } } return(true); }
/// <summary> /// Creates a new MultiTypeValue instance containing the given value. /// </summary> /// /// <param name="value">The value that this should contain.</param> public MultiTypeValue(MultiTypeDictionary value) { m_type = Type.Dictionary; m_value = value; }
/// <summary> /// Returns whether or not this contains the given value. /// </summary> /// /// <param name="value">The value to look up.</param> public bool Contains(MultiTypeDictionary value) { return(Contains(new MultiTypeValue(value))); }
/// <summary> /// Adds a new value to the list description. /// </summary> /// /// <param name="value">The value which should be added.</param> public MultiTypeListBuilder Add(MultiTypeDictionary value) { return(Add(new MultiTypeValue(value))); }
/// <summary> /// Adds a new value to the dictionary description. /// </summary> /// /// <param name="key">The key this value should be stored under.</param> /// <param name="value">The value which should be added.</param> public MultiTypeDictionaryBuilder Add(string key, MultiTypeDictionary value) { return(Add(key, new MultiTypeValue(value))); }