Exemple #1
0
        //==========================================================================================
        // Methods
        //==========================================================================================

        /// <summary>
        /// Creates the most specific file node type from the file's extension.
        /// </summary>
        /// <param name="absolutePath">The path to the file.</param>
        /// <returns>The most specific <see cref="FileNode"/> object for the OS file.</returns>
        public override FileNode CreateFileNodeFromExtension(string absolutePath)
        {
            Tracer.VerifyStringArgument(absolutePath, "absolutePath");
            FileNode node;

            string extension = Path.GetExtension(absolutePath).ToLower(CultureInfo.InvariantCulture);

            switch (extension)
            {
            case ".wixlib":
                node = new WixlibReferenceFileNode(this, absolutePath);
                break;

            case ".wxs":
            case ".wxi":
            case ".wxl":
            case ".wixout":
                node = new WixFileNode(this, absolutePath);
                break;

            default:
                node = base.CreateFileNodeFromExtension(absolutePath);
                break;
            }

            return(node);
        }
        //==========================================================================================
        // Methods
        //==========================================================================================
        /// <summary>
        /// Creates the most specific file node type from the file's extension.
        /// </summary>
        /// <param name="absolutePath">The path to the file.</param>
        /// <returns>The most specific <see cref="FileNode"/> object for the OS file.</returns>
        public override FileNode CreateFileNodeFromExtension(string absolutePath)
        {
            Tracer.VerifyStringArgument(absolutePath, "absolutePath");
            FileNode node;

            string extension = Path.GetExtension(absolutePath).ToLower(CultureInfo.InvariantCulture);
            switch (extension)
            {
                case ".wixlib":
                    node = new WixlibReferenceFileNode(this, absolutePath);
                    break;

                case ".wxs":
                case ".wxi":
                case ".wxl":
                case ".wixout":
                    node = new WixFileNode(this, absolutePath);
                    break;

                default:
                    node = base.CreateFileNodeFromExtension(absolutePath);
                    break;
            }

            return node;
        }