/// <summary> /// Copy all given argument values into this object. /// </summary> /// <param name="other"> /// The <see cref="Spring.Objects.Factory.Config.ConstructorArgumentValues"/> /// to be used to populate this instance. /// </param> public void AddAll(ConstructorArgumentValues other) { if (other != null) { if (other._genericArgumentValues != null && other._genericArgumentValues.Count > 0) { GetAndInitializeGenericArgumentValuesIfNeeded().AddRange(other._genericArgumentValues); } if (other._indexedArgumentValues != null && other._indexedArgumentValues.Count > 0) { foreach (var entry in other._indexedArgumentValues) { ValueHolder vh = entry.Value; if (vh != null) { AddOrMergeIndexedArgumentValues(entry.Key, vh.Copy()); } } } if (other._namedArgumentValues != null && other._namedArgumentValues.Count > 0) { foreach (var entry in other._namedArgumentValues) { AddOrMergeNamedArgumentValues(entry.Key, entry.Value); //NamedArgumentValues.Add(entry.Key, entry.Value); } } } }
/// <summary> /// Copy all given argument values into this object. /// </summary> /// <param name="other"> /// The <see cref="Spring.Objects.Factory.Config.ConstructorArgumentValues"/> /// to be used to populate this instance. /// </param> public void AddAll(ConstructorArgumentValues other) { if (other != null) { foreach (object o in other.GenericArgumentValues) { GenericArgumentValues.Add(o); } foreach (DictionaryEntry entry in other.IndexedArgumentValues) { ValueHolder vh = entry.Value as ValueHolder; if (vh != null) { AddOrMergeIndexedArgumentValues((int)entry.Key, vh.Copy()); } } foreach (DictionaryEntry entry in other.NamedArgumentValues) { NamedArgumentValues.Add(entry.Key, entry.Value); } } }
/// <summary> /// Copy all given argument values into this object. /// </summary> /// <param name="other"> /// The <see cref="Spring.Objects.Factory.Config.ConstructorArgumentValues"/> /// to be used to populate this instance. /// </param> public void AddAll(ConstructorArgumentValues other) { if (other != null) { foreach (ValueHolder o in other.GenericArgumentValues) { GenericArgumentValues.Add(o); } foreach (KeyValuePair <int, ValueHolder> entry in other.IndexedArgumentValues) { ValueHolder vh = entry.Value; if (vh != null) { AddOrMergeIndexedArgumentValues(entry.Key, vh.Copy()); } } foreach (KeyValuePair <string, object> entry in other.NamedArgumentValues) { AddOrMergeNamedArgumentValues(entry.Key, entry.Value); //NamedArgumentValues.Add(entry.Key, entry.Value); } } }