コード例 #1
0
        /// <summary>
        /// Returns a new frame of the given type.
        /// </summary>
        /// <param name="frameType">The type of frame to return.</param>
        /// <returns>A new frame of the given type.</returns>
        internal static ID3v2Frame GetNewFrame(FrameType frameType)
        {
            if (!prototypeRegistry.ContainsKey(frameType))
            {
                throw new FrameTypeNotRegisteredException(frameType);
            }

            ID3v2Frame prototypeFrame = prototypeRegistry[frameType];
            ID3v2Frame newFrame       = prototypeFrame.Copy();

            newFrame.Type = frameType;

            return(newFrame);
        }