/// <summary> /// Adds the elements of a <see cref="OptionCollection"/> to the end of the collection. /// </summary> /// <param name="items">The <see cref="OptionCollection"/> to be added to the end of the collection.</param> public void AddRange(OptionCollection items) { for (int i = 0; (i < items.Count); i = (i + 1)) { Add(items[i]); } }
/// <summary> /// Initializes a new instance of the <see cref="OptionCollection"/> class /// with the specified <see cref="OptionCollection"/> instance. /// </summary> public OptionCollection(OptionCollection value) { AddRange(value); }
/// <summary> /// Initializes a new instance of the <see cref="OptionEnumerator"/> class /// with the specified <see cref="OptionCollection"/>. /// </summary> /// <param name="arguments">The collection that should be enumerated.</param> internal OptionEnumerator(OptionCollection arguments) { IEnumerable temp = (IEnumerable) (arguments); _baseEnumerator = temp.GetEnumerator(); }
/// <summary> /// Initializes a new instance of the <see cref="OptionEnumerator"/> class /// with the specified <see cref="OptionCollection"/>. /// </summary> /// <param name="arguments">The collection that should be enumerated.</param> internal OptionEnumerator(OptionCollection arguments) { IEnumerable temp = (IEnumerable)(arguments); _baseEnumerator = temp.GetEnumerator(); }
/// <summary> /// Converts an <see cref="OptionCollection"/> to a <see cref="Hashtable"/>. /// </summary> private Hashtable OptionCollectionToHashtable(OptionCollection options, string optionSetName) { Hashtable convertedOptions = new Hashtable(); if (options != null) { foreach (object option in options) { string name; string value; Option ov = (Option) option; name = ov.OptionName; value = ov.Value; Log(Level.Verbose, " -- {0} = {1}", name, value); if (name == null) { throw new BuildException(string.Format(CultureInfo.InvariantCulture, "Unspecified name for <{0}> option '{1}'.", optionSetName, name), Location); } else if (value == null) { throw new BuildException(string.Format(CultureInfo.InvariantCulture, "Unspecified value for <{0}> option '{1}'.", optionSetName, name), Location); } else { convertedOptions.Add(name, value); } } } return convertedOptions; }