Exemplo n.º 1
0
        /// <summary>
        /// Adds the contents of an existing SoundDictionary to a new one.
        /// </summary>
        /// <param name="soundDictionary">
        /// The SoundDictionary to copy.
        /// </param>
        public SoundDictionary(SoundDictionary soundDictionary)
        {
            if (soundDictionary == null)
            {
                throw new ArgumentNullException("soundDictionary");
            }
            IDictionaryEnumerator enumer = soundDictionary.GetEnumerator();

            while (enumer.MoveNext())
            {
                this.Add((string)enumer.Key, (Sound)enumer.Value);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds an existing SoundDictionary to the Dictionary.
        /// </summary>
        /// <param name="soundDictionary">
        /// The SoundDictionary to add.
        /// </param>
        /// <returns>
        /// The final number of objects within the Dictionary.
        /// </returns>
        public int Add(SoundDictionary soundDictionary)
        {
            if (soundDictionary == null)
            {
                throw new ArgumentNullException("soundDictionary");
            }
            IDictionaryEnumerator dict = soundDictionary.GetEnumerator();

            while (dict.MoveNext())
            {
                this.Add((string)dict.Key, (Sound)dict.Value);
            }
            return(this.Count);
        }