Exemplo n.º 1
0
 /// <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);
         }
     }
 }
 /// <summary>
 /// Add generic argument value to be matched by type.
 /// </summary>
 /// <param name="value">The argument value.</param>
 /// <param name="type">
 /// The <see cref="System.Type.FullName"/> of the argument
 /// <see cref="System.Type"/>.
 /// </param>
 public virtual void AddGenericArgumentValue(object value, string type)
 {
     GenericArgumentValues.Add(new ValueHolder(value, type));
 }