/// <summary>
        /// Gets an array of data entities representing the specified <paramref name="mediaEncoderSettings" />.
        /// The instance can be converted to a JSON string and sent to the browser.
        /// </summary>
        /// <param name="mediaEncoderSettings">The settings to convert.</param>
        /// <returns>
        /// An array of <see cref="Entity.MediaEncoderSettings" /> instances.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="mediaEncoderSettings"/> is null.</exception>
        public static Entity.MediaEncoderSettings[] ToEntities(IMediaEncoderSettingsCollection mediaEncoderSettings)
        {
            if (mediaEncoderSettings == null)
                throw new ArgumentNullException("mediaEncoderSettings");

            List<Entity.MediaEncoderSettings> entities = new List<Entity.MediaEncoderSettings>(mediaEncoderSettings.Count);

            foreach (IMediaEncoderSettings encoderSetting in mediaEncoderSettings)
            {
                entities.Add(ToMediaEncoderSettingsEntity(encoderSetting));
            }

            return entities.ToArray();
        }
Пример #2
0
        /// <summary>
        /// Gets an array of data entities representing the specified <paramref name="mediaEncoderSettings" />.
        /// The instance can be converted to a JSON string and sent to the browser.
        /// </summary>
        /// <param name="mediaEncoderSettings">The settings to convert.</param>
        /// <returns>
        /// An array of <see cref="Entity.MediaEncoderSettings" /> instances.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="mediaEncoderSettings"/> is null.</exception>
        public static Entity.MediaEncoderSettings[] ToEntities(IMediaEncoderSettingsCollection mediaEncoderSettings)
        {
            if (mediaEncoderSettings == null)
            {
                throw new ArgumentNullException("mediaEncoderSettings");
            }

            List <Entity.MediaEncoderSettings> entities = new List <Entity.MediaEncoderSettings>(mediaEncoderSettings.Count);

            foreach (IMediaEncoderSettings encoderSetting in mediaEncoderSettings)
            {
                entities.Add(ToMediaEncoderSettingsEntity(encoderSetting));
            }

            return(entities.ToArray());
        }