Esempio n. 1
0
 /// <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]);
     }
 }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
 /// <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();
 }
Esempio n. 4
0
 /// <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]);
     }
 }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
        /// <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();
        }
Esempio n. 7
0
        /// <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;
        }