Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodecFactoryEntry"/> class.
        /// </summary>
        /// <param name="getCodecAction">Delegate which initializes a codec decoder based on a <see cref="Stream"/>.</param>
        /// <param name="fileExtensions">All which the codec associated file extensions.</param>
        public CodecFactoryEntry(GetCodecAction getCodecAction, params string[] fileExtensions)
        {
            if (getCodecAction == null)
                throw new ArgumentNullException("getCodecAction");
            if (fileExtensions == null || fileExtensions.Length <= 0)
                throw new ArgumentException("No specified file extensions.", "fileExtensions");

            fileExtensions = fileExtensions.Where(x => x != null).Select(x => x.Replace(".", String.Empty)).ToArray();

            GetCodecAction = getCodecAction;
            FileExtensions = new ReadOnlyCollection<string>(fileExtensions);
        }
Example #2
0
        public CodecFactoryEntry(GetCodecAction getCodecAction, params string[] fileextensions)
        {
            if (getCodecAction == null)
            {
                throw new ArgumentNullException("GetCodecAction");
            }
            if (fileextensions == null || fileextensions.Length <= 0)
            {
                throw new ArgumentException("No fileextensions", "fileextensions");
            }

            GetCodecAction = getCodecAction;
            FileExtensions = fileextensions;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodecFactoryEntry"/> class.
        /// </summary>
        /// <param name="getCodecAction">Delegate which initializes a codec decoder based on a <see cref="Stream"/>.</param>
        /// <param name="fileExtensions">All which the codec associated file extensions.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="getCodecAction"/> argument is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentException"><paramref name="fileExtensions"/> argument is <see langword="null"/> or empty.</exception>
        public CodecFactoryEntry(GetCodecAction getCodecAction, params string[] fileExtensions)
        {
            if (getCodecAction == null)
            {
                throw new ArgumentNullException("getCodecAction");
            }
            if (fileExtensions == null || fileExtensions.Length <= 0)
            {
                throw new ArgumentException("No specified file extensions.", "fileExtensions");
            }

            fileExtensions = fileExtensions.Where(x => x != null).Select(x => x.Replace(".", String.Empty)).ToArray();

            GetCodecAction = getCodecAction;
            FileExtensions = new ReadOnlyCollection <string>(fileExtensions);
        }