コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaBuilder"/> class.
        /// </summary>
        /// <param name="path">The output media file path.</param>
        public MediaBuilder(string path)
        {
            if (!Path.IsPathRooted(path))
            {
                throw new ArgumentException($"The path \"{path}\" is not valid");
            }

            container  = OutputContainer.Create(path);
            outputPath = path;
        }
コード例 #2
0
        private MediaBuilder(string path, ContainerFormat?format)
        {
            if (!Path.IsPathRooted(path))
            {
                throw new ArgumentException($"The path \"{path}\" is not valid.");
            }

            if (!Path.HasExtension(path) && format == null)
            {
                throw new ArgumentException("The file path has no extension.");
            }

            container  = OutputContainer.Create(format?.GetDescription() ?? Path.GetExtension(path));
            outputPath = path;
        }