/// <summary>
        /// Adds the new output from the specified parameters
        /// </summary>
        public override void Execute()
        {
            IVsdDeployable deployable = (IVsdDeployable)SetupProject.Object;
            IVsdProject    project    = (IVsdProject)deployable.GetParent();

            if (Folder == null)
            {
                project.AddOutputGroup(ProjectOutputKind, InputProject.UniqueName);
            }
            else // Folder is not null, so let's add it manually
            {
                IVsdCollectionSubset    plugins        = deployable.GetPlugIns();
                IVsdProjectOutputPlugIn projectsPlugin = plugins.Item("ProjectOutput") as IVsdProjectOutputPlugIn;
                projectOutput =
                    (IVsdProjectOutputGroup)DteHelper.CoCreateInstance(
                        this.Site,
                        typeof(VsdProjectOutputGroupClass),
                        typeof(IVsdProjectOutputGroup));
                //projectOutput.OutputConfig = null;
                projectOutput.OutputGroup   = ProjectOutputKind;
                projectOutput.OutputProject = InputProject.UniqueName;
                projectOutput.ShowKeyOutput = true;
                projectOutput.Folder        = vsdFolder;
                projectsPlugin.Items.Add(projectOutput);
            }
            // Collapse to project definition.
            UIHierarchyItem uiitem = DteHelper.SelectItem(SetupProject.DTE,
                                                          DteHelper.BuildPath(SetupProject));

            if (uiitem != null)
            {
                uiitem.UIHierarchyItems.Expanded = false;
            }
        }
示例#2
0
        private void DeleteMergeModule()
        {
            IVsdDeployable        deployable   = (IVsdDeployable)SetupProject.Object;
            IVsdProject           project      = (IVsdProject)deployable.GetParent();
            IVsdCollectionSubset  plugins      = deployable.GetPlugIns();
            IVsdMergeModulePlugIn modulePlugin = plugins.Item("MergeModule") as IVsdMergeModulePlugIn;

            modulePlugin.Items.RemoveObject(File);
            File = null;
        }
示例#3
0
        private void AddSimpleFile()
        {
            IVsdDeployable       deployable = (IVsdDeployable)SetupProject.Object;
            IVsdProject          project    = (IVsdProject)deployable.GetParent();
            IVsdCollectionSubset plugins    = deployable.GetPlugIns();
            IVsdFilePlugIn       filePlugin = plugins.Item("File") as IVsdFilePlugIn;
            IVsdFile             vsdFile    =
                (IVsdFile)DteHelper.CoCreateInstance(
                    this.Site,
                    typeof(VsdFileClass),
                    typeof(IVsdFile));

            vsdFile.TargetName = Path.GetFileName(this.InputFileName);
            vsdFile.SourcePath = this.InputFileName;
            vsdFile.Folder     = this.vsdFolder;
            filePlugin.Items.Add(vsdFile);
            file = vsdFile;
        }
示例#4
0
        private void AddMergeModule()
        {
            IVsdDeployable        deployable   = (IVsdDeployable)SetupProject.Object;
            IVsdProject           project      = (IVsdProject)deployable.GetParent();
            IVsdCollectionSubset  plugins      = deployable.GetPlugIns();
            IVsdMergeModulePlugIn modulePlugin = plugins.Item("MergeModule") as IVsdMergeModulePlugIn;
            IVsdModule            vsdModule    =
                (IVsdModule)DteHelper.CoCreateInstance(
                    this.Site,
                    typeof(VsdModuleClass),
                    typeof(IVsdModule));

            vsdModule.UseDynamicProperties = true;
            vsdModule.SourcePath           = this.InputFileName;
            vsdModule.Folder = this.vsdFolder;
            modulePlugin.Items.Add(vsdModule);
            file = vsdModule;
        }
示例#5
0
        /// <summary>
        /// Adds the new file to the setup project
        /// </summary>
        public override void Execute()
        {
            IVsdDeployable deployable = (IVsdDeployable)SetupProject.Object;
            IVsdProject    project    = (IVsdProject)deployable.GetParent();

            if (Folder == null)
            {
                project.AddFile(InputFileName);
            }
            else
            {
                if (Path.GetExtension(this.InputFileName).Equals(".msm"))
                {
                    AddMergeModule();
                }
                else
                {
                    AddSimpleFile();
                }
            }
        }