Exemplo n.º 1
0
        ///// <summary>
        ///// Adds a surface Dictionary to the Dictionary as an animation.
        ///// </summary>
        ///// <param name="key">The name of the animation.</param>
        ///// <param name="surfaces">The SurfaceDictionary that represents the animation.</param>
        ///// <returns>The final number of elements within the Dictionary.</returns>
        //public int Add(string key, SurfaceCollection surfaces)
        //{
        //    this.Add(key, new AnimationCollection(surfaces));
        //    return this.Count;
        //}

        /// <summary>
        /// Adds a Dictionary of music to the current music Dictionary.
        /// </summary>
        /// <param name="animationDictionary">
        /// The Dictionary of
        /// music samples to add.
        /// </param>
        /// <returns>
        /// The total number of elements within
        /// the Dictionary after adding the sample.
        /// </returns>
        public int Add(AnimationDictionary animationDictionary)
        {
            if (animationDictionary == null)
            {
                throw new ArgumentNullException("animationDictionary");
            }
            IDictionaryEnumerator dict = animationDictionary.GetEnumerator();

            while (dict.MoveNext())
            {
                this.Add((string)dict.Key, (AnimationCollection)dict.Value);
            }
            return(this.Count);
        }
Exemplo n.º 2
0
        ///// <summary>
        ///// Creates an AnimationDictionary with a "Default" animation of surfaces.
        ///// </summary>
        ///// <param name="surfaces"></param>
        //public AnimationDictionary(SurfaceCollection surfaces)
        //{
        //    this.Add("Default", surfaces);
        //}


        /// <summary>
        /// Creates a new AnimationDictionary with the contents of an existing AnimationDictionary.
        /// </summary>
        /// <param name="animationDictionary">The existing music Dictionary to add.</param>
        public AnimationDictionary(AnimationDictionary animationDictionary)
        {
            this.Add(animationDictionary);
        }