コード例 #1
0
        protected override ReferenceNode CreateFileComponent(VSCOMPONENTSELECTORDATA selectorData)
        {
            if (!File.Exists(selectorData.bstrFile))
            {
                return(null);
            }

            WixProjectNode projectNode = this.ProjectMgr as WixProjectNode;

            WixHelperMethods.ShipAssert(projectNode != null, "ProjectMgr is null or is not WixProjectNode.");

            switch (Path.GetExtension(selectorData.bstrFile))
            {
            case ".wixlib":
                return(new WixLibraryReferenceNode(projectNode, projectNode.GetRelativePath(selectorData.bstrFile)));

            case ".dll":
                return(new WixExtensionReferenceNode(projectNode, selectorData.bstrFile));

            default:
                string message = String.Format(CultureInfo.CurrentUICulture, WixStrings.WixReferenceInvalid, selectorData.bstrFile);
                WixHelperMethods.ShowErrorMessageBox(this.ProjectMgr.Site, message);
                return(null);
            }
        }
コード例 #2
0
        /// <summary>
        /// Shows invalid Wix reference message.
        /// </summary>
        protected void ShowInvalidWixReferenceMessage()
        {
            string errorMessage = String.Format(CultureInfo.CurrentUICulture, WixStrings.WixReferenceInvalid, this.Url);

            WixHelperMethods.ShowErrorMessageBox(this.ProjectMgr.Site, errorMessage);
        }