Пример #1
0
        /// <summary>
        /// Copies a specified part and inserts the copy at the index of a target part.
        /// </summary>
        /// <param name="source">The part to copy.</param>
        /// <param name="name">The name that will be given to the copy.</param>
        /// <param name="target">The target position.</param>
        /// <returns>The created copy.</returns>
        public SongPart CopyPart(SongPart source, string name, SongPart target)
        {
            SongPart newPart;

            using (Undo.ChangeFactory.Batch(this, "CopyPart"))
            {
                newPart = source.Copy(name);
                AddPart(newPart);
                MovePart(newPart, target);
            }
            return(newPart);
        }
Пример #2
0
		/// <summary>
		/// Copies a specified part and inserts the copy at the index of a target part.
		/// </summary>
		/// <param name="source">The part to copy.</param>
		/// <param name="name">The name that will be given to the copy.</param>
		/// <param name="target">The target position.</param>
		/// <returns>The created copy.</returns>
		public SongPart CopyPart(SongPart source, string name, SongPart target)
		{
			SongPart newPart;
			using (Undo.ChangeFactory.Batch(this, "CopyPart"))
			{
				newPart = source.Copy(name);
				AddPart(newPart);
				MovePart(newPart, target);
			}
			return newPart;
		}