public void SetUpFixture()
		{
			SD.InitializeForUnitTests();
			WixBindingTestsHelper.RegisterResourceStringsWithSharpDevelopResourceManager();

			wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
			parentNode = new TreeNode();
			WixProjectNodeBuilder builder = new WixProjectNodeBuilder();
			wixProjectNode = builder.AddProjectNode(parentNode, wixProject) as ProjectNode;
			
			foreach (TreeNode node in wixProjectNode.Nodes) {
				if (node is WixLibraryFolderNode) {
					wixLibraryFolderNode = node as WixLibraryFolderNode;
				} else if (node is WixExtensionFolderNode) {
					wixExtensionFolderNode = node as WixExtensionFolderNode;
				}
			}
			
			foreach (TreeNode node in wixProjectNode.Nodes) {
				referenceFolderNode = node as ReferenceFolder;
				if (referenceFolderNode != null) {
					break;
				}
			}
		}
        void OpenNewPackageFilesView(WixProject project)
        {
            PackageFilesView view = factory.Create(project, workbench);

            workbench.ShowView(view);
            view.ShowFiles();
        }
Exemplo n.º 3
0
        public override void Run()
        {
            // Get FolderNode.
            CustomFolderNode folderNode = GetFolderNode(FolderNodeType);

            if (folderNode == null)
            {
                return;
            }

            // Display file dialog.
            using (OpenFileDialog fileDialog = CreateOpenFileDialog(FileFilter)) {
                if (DialogResult.OK == fileDialog.ShowDialog(WorkbenchSingleton.MainWin32Window))
                {
                    // Add files to project.
                    WixProject project = ((WixProject)folderNode.Project);
                    AddFiles(project, fileDialog.FileNames);
                    project.Save();
                }
            }

            // Refresh project browser.
            folderNode.Refresh();
            folderNode.Expanding();
            folderNode.Expand();
        }
Exemplo n.º 4
0
        public override void Run()
        {
            // Get WixExtensionFolderNode.
            WixExtensionFolderNode folderNode = GetWixExtensionFolderNode();

            if (folderNode == null)
            {
                return;
            }

            // Display file dialog.
            using (OpenFileDialog fileDialog = CreateOpenFileDialog()) {
                if (DialogResult.OK == fileDialog.ShowDialog(WorkbenchSingleton.MainForm))
                {
                    // Add files to project.
                    WixProject project = ((WixProject)folderNode.Project);
                    project.AddWixExtensions(fileDialog.FileNames);
                    project.Save();
                }
            }

            // Refresh project browser.
            folderNode.Refresh();
            folderNode.Expanding();
            folderNode.Expand();
        }
		public void SetUpFixture()
		{
			ResourceManager rm = new ResourceManager("WixBinding.Tests.Strings", GetType().Assembly);
			ResourceService.RegisterNeutralStrings(rm);

			wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
			parentNode = new TreeNode();
			WixProjectNodeBuilder builder = new WixProjectNodeBuilder();
			wixProjectNode = builder.AddProjectNode(parentNode, wixProject) as ProjectNode;
			
			foreach (TreeNode node in wixProjectNode.Nodes) {
				if (node is WixLibraryFolderNode) {
					wixLibraryFolderNode = node as WixLibraryFolderNode;
				} else if (node is WixExtensionFolderNode) {
					wixExtensionFolderNode = node as WixExtensionFolderNode;
				}
			}
			
			foreach (TreeNode node in wixProjectNode.Nodes) {
				referenceFolderNode = node as ReferenceFolder;
				if (referenceFolderNode != null) {
					break;
				}
			}
		}
		public void SetUpFixture()
		{
			SD.InitializeForUnitTests();
			WixBindingTestsHelper.InitMSBuildEngine();
			
			// create the project.
			ProjectCreateInformation info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj"));

			wixProject = new WixProjectWithOverriddenSave(info);
			
			// Add wix extensionitem.
			wixExtensionItem = new WixExtensionProjectItem(wixProject);
			wixExtensionItem.Include = @"..\..\first.dll";
			ProjectService.AddProjectItem(wixProject, wixExtensionItem);
			
			// Run Initialize on the WixExtensionFolderNode, which is 
			// equivalent to expanding the node, so it adds it children. Cannot
			// call ExtTreeNode.Expanding since this relies on the tree node
			// being visible.
			WixExtensionFolderNodeTester nodeTester = new WixExtensionFolderNodeTester(wixProject);
			nodeTester.RunInitialize();
			
			wixExtensionFolderNode = (WixExtensionFolderNode)nodeTester;
			wixExtensionNode = (WixExtensionNode)wixExtensionFolderNode.Nodes[0];
		}
		public void SetUpFixture()
		{
			wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
			
			// Add wix Extension item.
			firstWixExtensionItem = new WixExtensionProjectItem(wixProject);
			firstWixExtensionItem.Include = @"..\..\first-ext.dll";
			ProjectService.AddProjectItem(wixProject, firstWixExtensionItem);
			
			// Add another wix Extension item.
			secondWixExtensionItem = new WixExtensionProjectItem(wixProject);
			secondWixExtensionItem.Include = @"..\..\second-ext.dll";
			ProjectService.AddProjectItem(wixProject, secondWixExtensionItem);

			// Run Initialize on the WixExtensionFolderNode, which is 
			// equivalent to expanding the node, so it adds it children. Cannot
			// call ExtTreeNode.Expanding since this relies on the tree node
			// being visible.
			WixExtensionFolderNodeTester nodeTester = new WixExtensionFolderNodeTester(wixProject);
			nodeTester.RunInitialize();
			
			wixExtensionFolderNode = (WixExtensionFolderNode)nodeTester;
			if (wixExtensionFolderNode.Nodes.Count > 1) {
				firstWixExtensionNode = (WixExtensionNode)wixExtensionFolderNode.Nodes[0];
				secondWixExtensionNode = (WixExtensionNode)wixExtensionFolderNode.Nodes[1];
			}
		}
		public void SetUpFixture()
		{
			WixBindingTestsHelper.InitMSBuildEngine();
			
			// create the project.
			ProjectCreateInformation info = new ProjectCreateInformation();
			info.Solution = new Solution();
			info.ProjectName = "Test";
			info.OutputProjectFileName = @"C:\Projects\Test\Test.wixproj";

			wixProject = new WixProjectWithOverriddenSave(info);
			
			// Add wix library item.
			wixLibraryItem = new WixLibraryProjectItem(wixProject);
			wixLibraryItem.Include = @"..\..\first.wixlib";
			ProjectService.AddProjectItem(wixProject, wixLibraryItem);
			
			// Run Initialize on the WixLibraryFolderNode, which is 
			// equivalent to expanding the node, so it adds it children. Cannot
			// call ExtTreeNode.Expanding since this relies on the tree node
			// being visible.
			WixLibraryFolderNodeTester nodeTester = new WixLibraryFolderNodeTester(wixProject);
			nodeTester.RunInitialize();
			
			wixLibraryFolderNode = (WixLibraryFolderNode)nodeTester;
			wixLibraryNode = (WixLibraryNode)wixLibraryFolderNode.Nodes[0];
		}
		public void SetUpFixture()
		{
			SD.InitializeForUnitTests();
			wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
			
			// Add wix library item.
			firstWixLibraryItem = new WixLibraryProjectItem(wixProject);
			firstWixLibraryItem.Include = @"..\..\first.wixlib";
			ProjectService.AddProjectItem(wixProject, firstWixLibraryItem);
			
			// Add another wix library item.
			secondWixLibraryItem = new WixLibraryProjectItem(wixProject);
			secondWixLibraryItem.Include = @"..\..\second.wixlib";
			ProjectService.AddProjectItem(wixProject, secondWixLibraryItem);

			// Run Initialize on the WixLibraryFolderNode, which is 
			// equivalent to expanding the node, so it adds it children. Cannot
			// call ExtTreeNode.Expanding since this relies on the tree node
			// being visible.
			WixLibraryFolderNodeTester nodeTester = new WixLibraryFolderNodeTester(wixProject);
			nodeTester.RunInitialize();
			
			wixLibraryFolderNode = (WixLibraryFolderNode)nodeTester;
			firstWixLibraryNode = (WixLibraryNode)wixLibraryFolderNode.Nodes[0];
			secondWixLibraryNode = (WixLibraryNode)wixLibraryFolderNode.Nodes[1];
		}
Exemplo n.º 10
0
 /// <summary>
 /// Loads the Wix document containing the directory information and displays it.
 /// </summary>
 public void ShowFiles(WixProject project, ITextFileReader fileReader, IWixDocumentWriter documentWriter)
 {
     this.project = project;
     editor       = new WixPackageFilesEditor(this, fileReader, documentWriter);
     editor.ExcludedItems.AddRange(GetExcludedItems());
     editor.ShowFiles(project);
 }
Exemplo n.º 11
0
		/// <summary>
		/// Displays the setup files for the specified WixProject.
		/// </summary>
		public void ShowFiles(WixProject project)
		{
			// Look for Wix document containing root directory.
			document = null;
			view.ContextMenuEnabled = false;
			if (project.WixSourceFiles.Count > 0) {
				bool errors = false;
				WixDocument currentDocument = null;
				view.ClearDirectories();
				foreach (FileProjectItem item in project.WixSourceFiles) {
					try {
						currentDocument = CreateWixDocument(item.FileName);
						FindRootDirectoryResult result = FindRootDirectory(currentDocument);
						if (result == FindRootDirectoryResult.RootDirectoryRefFound) {
							break;
						}
					} catch (XmlException) {
						errors = true;
					}
				}
				if (errors) {
					view.ShowSourceFilesContainErrorsMessage();
				} else if (document == null) {
					view.ShowNoRootDirectoryFoundMessage();
				} else {
					view.ContextMenuEnabled = true;
					SelectedElementChanged();
				}
			} else {
				view.ShowNoSourceFileFoundMessage(project.Name);
			}
		}
		public void Init()
		{
			workbench = new MockWorkbench();
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			packageFilesView = new PackageFilesView(project, workbench);
			
			workbench.ActiveViewContent = packageFilesView;
		}
		public void Init()
		{
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			factory = new MockPackageFilesViewFactory();
			workbench = new MockWorkbench();
			
			view = factory.Create(project, workbench);
		}
Exemplo n.º 14
0
		PackageFilesView(WixProject project)
		{
			packageFilesControl = new WixPackageFilesControl();
			packageFilesControl.DirtyChanged += delegate { base.RaiseIsDirtyChanged(); };
			TitleName = StringParser.Parse("${res:ICSharpCode.WixBinding.PackageFilesView.Title}");
			this.project = project;
			
			WorkbenchSingleton.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
		}
Exemplo n.º 15
0
        PackageFilesView(WixProject project)
        {
            packageFilesControl = new WixPackageFilesControl();
            packageFilesControl.DirtyChanged += delegate { base.RaiseIsDirtyChanged(); };
            TitleName    = StringParser.Parse("${res:ICSharpCode.WixBinding.PackageFilesView.Title}");
            this.project = project;

            WorkbenchSingleton.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
        }
Exemplo n.º 16
0
		public void Run(WixProject project)
		{
			PackageFilesView openView = GetOpenPackageFilesView(project);
			if (openView != null) {
				openView.WorkbenchWindow.SelectWindow();
			} else {
				OpenNewPackageFilesView(project);
			}
		}
		public PackageFilesView Create(WixProject project, IWorkbench workbench)
		{
			createMethodProjectParameter = project;
			createMethodWorkbenchParameter = workbench;
			packageFilesControl = new MockWixPackageFilesControl();
			
			packageFilesViewCreated = new PackageFilesView(project, workbench, packageFilesControl);
			return packageFilesViewCreated;
		}
		public void Init()
		{
			workbench = new MockWorkbench();
			factory = new MockPackageFilesViewFactory();
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			
			ViewSetupFilesCommand viewCommand = new ViewSetupFilesCommand(factory, workbench);
			viewCommand.Run(project);
		}
Exemplo n.º 19
0
        public override void Run()
        {
            WixProject project = ProjectService.CurrentProject as WixProject;

            if (project != null)
            {
                PackageFilesView.Show(project, WorkbenchSingleton.Workbench);
            }
        }
        public override void Run()
        {
            WixProject project = ProjectService.CurrentProject as WixProject;

            if (project != null)
            {
                Run(project);
            }
        }
		void CreatePackageFilesViewWithProjectToBeUsedWithViewSetupFilesCommandRunMethod()
		{
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			packageFilesControl = new MockWixPackageFilesControl();
			existingView = new PackageFilesView(project, workbench, packageFilesControl);
			
			workbench.ShowView(existingView);

			CreateWorkbenchWindowForPackageFilesView(existingView);
		}
Exemplo n.º 22
0
		PackageFilesView GetOpenPackageFilesView(WixProject project)
		{
			foreach (IViewContent view in workbench.ViewContentCollection) {
				PackageFilesView packageFilesView = view as PackageFilesView;
				if ((packageFilesView != null) && (packageFilesView.IsForProject(project))) {
					return packageFilesView;
				}
			}
			return null;
		}		
		public void SetUpFixture()
		{
			SD.InitializeForUnitTests();
			WixBindingTestsHelper.InitMSBuildEngine();
			
			info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj"));
			info.RootNamespace = "Test";

			project = new WixProject(info);
		}
Exemplo n.º 24
0
 /// <summary>
 /// Creates a new instance of the WixDocument class but overrides the
 /// default file loading functionality of the WixDocument.
 /// </summary>
 public WixDocument(WixProject project, IFileLoader fileLoader)
 {
     this.project    = project;
     this.fileLoader = fileLoader;
     if (fileLoader == null)
     {
         throw new ArgumentException("Cannot be null.", "fileLoader");
     }
     namespaceManager = new WixNamespaceManager(NameTable);
 }
		public void InitFixture()
		{
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			project.Name = "MySetup";
			FileProjectItem item = new FileProjectItem(project, ItemType.Compile);
			item.Include = "Setup.wxs";
			ProjectService.AddProjectItem(project, item);
			view = new MockWixPackageFilesView();
			editor = new WixPackageFilesEditor(view, this, this, this);
			editor.ShowFiles(project);
		}
Exemplo n.º 26
0
		/// <summary>
		/// Creates a new instance of the WixDocument class but overrides the 
		/// default file loading functionality of the WixDocument. 
		/// </summary>
		public WixDocument(WixProject project, IFileLoader fileLoader)
		{
			this.project = project;
			this.fileLoader = fileLoader;
			
			if (fileLoader == null) {
				throw new ArgumentNullException("fileLoader");
			}
			
			namespaceManager = new WixNamespaceManager(NameTable);			
		}
Exemplo n.º 27
0
		/// <summary>
		/// Shows the view for the specified project.
		/// </summary>
		public static void Show(WixProject project, IWorkbench workbench)
		{
			PackageFilesView openView = GetOpenPackageFilesView(project, workbench);
			if (openView != null) {
				openView.WorkbenchWindow.SelectWindow();
			} else {
				PackageFilesView newView = new PackageFilesView(project);
				workbench.ShowView(newView);
				newView.ShowFiles();
			}
		}
Exemplo n.º 28
0
 /// <summary>
 /// Gets the package files view that is already open and displaying the files
 /// for the specified project.
 /// </summary>
 static PackageFilesView GetOpenPackageFilesView(WixProject project, IWorkbench workbench)
 {
     foreach (IViewContent view in workbench.ViewContentCollection)
     {
         PackageFilesView packageFilesView = view as PackageFilesView;
         if (packageFilesView != null && packageFilesView.Project == project)
         {
             return(packageFilesView);
         }
     }
     return(null);
 }
		public void SetUpFixture()
		{
			WixBindingTestsHelper.InitMSBuildEngine();
			
			info = new ProjectCreateInformation();
			info.Solution = new Solution();
			info.ProjectName = "Test";
			info.OutputProjectFileName = @"C:\Projects\Test\Test.wixproj";
			info.RootNamespace = "Test";

			project = new WixProject(info);
		}
 PackageFilesView GetOpenPackageFilesView(WixProject project)
 {
     foreach (IViewContent view in workbench.ViewContentCollection)
     {
         PackageFilesView packageFilesView = view as PackageFilesView;
         if ((packageFilesView != null) && (packageFilesView.IsForProject(project)))
         {
             return(packageFilesView);
         }
     }
     return(null);
 }
        public void Run(WixProject project)
        {
            PackageFilesView openView = GetOpenPackageFilesView(project);

            if (openView != null)
            {
                openView.WorkbenchWindow.SelectWindow();
            }
            else
            {
                OpenNewPackageFilesView(project);
            }
        }
		public void SetUpFixture()
		{
			string fileName1 = @"C:\Projects\Test\wixext\test.dll";
			string fileName2 = @"C:\Projects\Test\mainext\main.dll";
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			project.AddWixExtensions(new string[] {fileName1, fileName2});
			
			wixExtensionProjectItemCount = 0;
			foreach (ProjectItem item in project.Items) {
				if (item is WixExtensionProjectItem) {
					++wixExtensionProjectItemCount;
				}
			}
		}
		public void SetUpFixture()
		{
			string fileName1 = @"C:\Projects\Test\wixlibs\test.wixlib";
			string fileName2 = @"C:\Projects\Test\mainlibs\main.wixlib";
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			project.AddWixLibraries(new string[] {fileName1, fileName2});
			
			wixLibraryProjectItemCount = 0;
			foreach (ProjectItem item in project.Items) {
				if (item is WixLibraryProjectItem) {
					++wixLibraryProjectItemCount;
				}
			}
		}
Exemplo n.º 34
0
        /// <summary>
        /// Shows the view for the specified project.
        /// </summary>
        public static void Show(WixProject project, IWorkbench workbench)
        {
            PackageFilesView openView = GetOpenPackageFilesView(project, workbench);

            if (openView != null)
            {
                openView.WorkbenchWindow.SelectWindow();
            }
            else
            {
                PackageFilesView newView = new PackageFilesView(project);
                workbench.ShowView(newView);
                newView.ShowFiles();
            }
        }
		public void Init()
		{
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			mockWorkbench = new MockWorkbench();
			mockPackageFilesControl = new MockWixPackageFilesControl();
			textEditorOptions = new MockTextEditorOptions();
			textEditorOptions.ConvertTabsToSpaces = false;
			
			xmlTextWriter = new MockXmlTextWriter(textEditorOptions);
			packageFilesView = new PackageFilesView(project, mockWorkbench, mockPackageFilesControl, xmlTextWriter);
			
			mockWorkbench.ActiveContent = packageFilesView;
			
			document = new WixDocument(project, new DefaultFileLoader());
		}
Exemplo n.º 36
0
		public PackageFilesView(WixProject project, 
			IWorkbench workbench, 
			IWixPackageFilesControl packageFilesControl,
			WixTextWriter wixTextWriter)
		{
			this.packageFilesControl = packageFilesControl;
			packageFilesControl.DirtyChanged += delegate { base.RaiseIsDirtyChanged(); };
			SetLocalizedTitle("${res:ICSharpCode.WixBinding.PackageFilesView.Title}");
			this.project = project;
			
			this.workbench = workbench;
			wixDocumentWindow = new WixDocumentWindow(workbench);
			workbench.ActiveViewContentChanged += ActiveViewContentChanged;
			
			this.wixTextWriter = wixTextWriter;
			
			openTextEditors = new OpenTextEditors(workbench);
		}
Exemplo n.º 37
0
        public PackageFilesView(WixProject project,
                                IWorkbench workbench,
                                IWixPackageFilesControl packageFilesControl,
                                WixTextWriter wixTextWriter)
        {
            this.packageFilesControl          = packageFilesControl;
            packageFilesControl.DirtyChanged += delegate { base.RaiseIsDirtyChanged(); };
            SetLocalizedTitle("${res:ICSharpCode.WixBinding.PackageFilesView.Title}");
            this.project = project;

            this.workbench    = workbench;
            wixDocumentWindow = new WixDocumentWindow(workbench);
            workbench.ActiveViewContentChanged += ActiveViewContentChanged;

            this.wixTextWriter = wixTextWriter;

            openTextEditors = new OpenTextEditors(workbench);
        }
		public void Init()
		{
			viewWithOpenWixDocument = new MockTextEditorViewContent();
			viewWithOpenWixDocument.SetFileName(@"d:\projects\test\a.wxs");
			
			workbench = new MockWorkbench();
			workbench.ViewContentCollection.Add(viewWithOpenWixDocument);
			
			document = new WixDocument();
			document.FileName = @"d:\projects\test\a.wxs";
			
			packageFilesControl = new MockWixPackageFilesControl();
			packageFilesControl.Document = document;
			
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			packageFilesView = new PackageFilesView(project, workbench, packageFilesControl);
			
			AfterInit();
		}
Exemplo n.º 39
0
 /// <summary>
 /// Displays the setup files for the specified WixProject.
 /// </summary>
 public void ShowFiles(WixProject project)
 {
     // Look for Wix document containing root directory.
     document = null;
     view.ContextMenuEnabled = false;
     if (project.WixSourceFiles.Count > 0)
     {
         bool        errors          = false;
         WixDocument currentDocument = null;
         view.ClearDirectories();
         foreach (FileProjectItem item in project.WixSourceFiles)
         {
             try {
                 currentDocument = CreateWixDocument(item.FileName);
                 FindRootDirectoryResult result = FindRootDirectory(currentDocument);
                 if (result == FindRootDirectoryResult.RootDirectoryRefFound)
                 {
                     break;
                 }
             } catch (XmlException) {
                 errors = true;
             }
         }
         if (errors)
         {
             view.ShowSourceFilesContainErrorsMessage();
         }
         else if (document == null)
         {
             view.ShowNoRootDirectoryFoundMessage();
         }
         else
         {
             view.ContextMenuEnabled = true;
             SelectedElementChanged();
         }
     }
     else
     {
         view.ShowNoSourceFileFoundMessage(project.Name);
     }
 }
		public void SetUpFixture()
		{
			wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
			
			// Add wix library item.
			firstWixLibraryItem = new WixLibraryProjectItem(wixProject);
			firstWixLibraryItem.Include = "first.wixlib";
			ProjectService.AddProjectItem(wixProject, firstWixLibraryItem);
			
			// Add another wix library item.
			secondWixLibraryItem = new WixLibraryProjectItem(wixProject);
			secondWixLibraryItem.Include = "second.wixlib";
			ProjectService.AddProjectItem(wixProject, secondWixLibraryItem);
			
			// Add a wix extension item.
			firstWixExtensionItem = new WixExtensionProjectItem(wixProject);
			firstWixExtensionItem.Include = "first-ext.dll";
			ProjectService.AddProjectItem(wixProject, firstWixExtensionItem);
			
			wixLibraryFolderNode = new WixLibraryFolderNode(wixProject);
			wixExtensionFolderNode = new WixExtensionFolderNode(wixProject);
		}
Exemplo n.º 41
0
        /// <summary>
        /// Adds all the dialog ids from all the files in the project to the list view.
        /// </summary>
        /// <remarks>
        /// If an error occurs an error item is added to the list. The error
        /// list is only cleared the first time an error occurs
        /// since there may be multiple errors, one in each Wix file.
        /// Also we do not clear the error list unless we have an error
        /// so any previously added errors from a build, for example, are not
        /// cleared unless we have to.
        /// </remarks>
        void ShowDialogList()
        {
            // Make sure we do not leave any errors in the error list from a previous call.
            if (setupDialogListView.HasErrors)
            {
                WixBindingService.ClearErrorList();
            }

            setupDialogListView.Items.Clear();

            WixProject openWixProject = ProjectService.CurrentProject as WixProject;

            if (openWixProject != null)
            {
                bool clearedErrorList = false;
                foreach (FileProjectItem wixFile in openWixProject.WixFiles)
                {
                    if (File.Exists(wixFile.FileName))
                    {
                        try {
                            AddDialogListItems(wixFile.FileName);
                        } catch (XmlException ex) {
                            // Clear the error list the first time only.
                            if (!clearedErrorList)
                            {
                                clearedErrorList = true;
                                WixBindingService.ClearErrorList();
                            }
                            setupDialogListView.AddError(wixFile.FileName, ex);
                            WixBindingService.AddErrorToErrorList(wixFile.FileName, ex);
                        }
                    }
                }
                if (clearedErrorList)
                {
                    WixBindingService.ShowErrorList();
                }
            }
        }
        protected override void LoadInternal(OpenedFile file, Stream stream)
        {
            if (file == this.PrimaryFile)
            {
                // The FormsDesignerViewContent normally operates independently of any
                // text editor. The following statements connect the forms designer
                // directly to the underlying XML text editor so that the caret positioning
                // and text selection operations done by the WiX designer actually
                // become visible in the text editor.
                if (!this.SourceCodeStorage.ContainsFile(file))
                {
                    ITextEditor editor = this.PrimaryViewContent.GetService <ITextEditor>();
                    this.SourceCodeStorage.AddFile(file, editor.Document, SD.FileService.DefaultFileEncoding, true);
                }

                try {
                    if (!ignoreDialogIdSelectedInTextEditor)
                    {
                        string dialogId = GetDialogIdSelectedInTextEditor();
                        if (dialogId == null)
                        {
                            dialogId = GetFirstDialogIdInTextEditor();
                            JumpToDialogElement(dialogId);
                        }
                        DialogId = dialogId;
                    }
                    wixProject = GetProject();
                } catch (XmlException ex) {
                    // Let the Wix designer loader try to load the XML and generate
                    // an error message.
                    DialogId = "InvalidXML";
                    AddToErrorList(ex);
                }
            }
            base.LoadInternal(file, stream);
        }
Exemplo n.º 43
0
		public bool IsForProject(WixProject project)
		{
			return this.project == project;
		}
 public PackageFilesView Create(WixProject project, IWorkbench workbench)
 {
     return(new PackageFilesView(project, workbench));
 }
Exemplo n.º 45
0
		public PackageFilesView(WixProject project, IWorkbench workbench, IWixPackageFilesControl packageFilesControl)
			: this(project, workbench, packageFilesControl, null)
		{
			wixTextWriter = new WixTextWriter(GetTextEditorOptions());
		}
Exemplo n.º 46
0
		public PackageFilesView(WixProject project, IWorkbench workbench)
			: this(project, workbench, new WixPackageFilesControl())
		{
		}
Exemplo n.º 47
0
        void RefreshOutputFileNameTextBox(object sender, EventArgs e)
        {
            WixOutputType outputType = (WixOutputType)(Get <ComboBox>("outputType").SelectedIndex);

            Get <TextBox>("outputFileName").Text = Get <TextBox>("outputName").Text + WixProject.GetInstallerExtension(outputType.ToString());
        }
Exemplo n.º 48
0
 public WixStartBehavior(WixProject project, ProjectBehavior next = null)
     : base(project, next)
 {
 }
 /// <summary>
 /// Method used to add the files selected by the user to the project.
 /// </summary>
 protected abstract void AddFiles(WixProject project, string[] fileNames);
Exemplo n.º 50
0
 public PackageFilesView(WixProject project, IWorkbench workbench)
     : this(project, workbench, new WixPackageFilesControl())
 {
 }
Exemplo n.º 51
0
 public PackageFilesView(WixProject project, IWorkbench workbench, IWixPackageFilesControl packageFilesControl)
     : this(project, workbench, packageFilesControl, null)
 {
     wixTextWriter = new WixTextWriter(GetTextEditorOptions());
 }
Exemplo n.º 52
0
 public bool IsForProject(WixProject project)
 {
     return(this.project == project);
 }
Exemplo n.º 53
0
		/// <summary>
		/// Creates a new instance of the WixBinaries class.
		/// </summary>
		/// <remarks>
		/// The active document is checked first for the required binary then the 
		/// document's project is used to locate the binary in other files
		/// belonging to the project.
		/// </remarks>
		/// <param name="document">The active document. This is first checked
		/// for the specified binary before the rest of the files in the project.</param>
		/// <param name="reader">The text file reader to use when reading other
		/// project files.</param>
		public WixBinaries(WixDocument document, ITextFileReader reader)
		{
			activeDocument = document;
			project = document.Project;
			textFileReader = reader;
		}
Exemplo n.º 54
0
 /// <summary>
 /// Creates a new instance of the WixBinaries class.
 /// </summary>
 /// <remarks>
 /// The active document is checked first for the required binary then the
 /// document's project is used to locate the binary in other files
 /// belonging to the project.
 /// </remarks>
 /// <param name="document">The active document. This is first checked
 /// for the specified binary before the rest of the files in the project.</param>
 /// <param name="reader">The text file reader to use when reading other
 /// project files.</param>
 public WixBinaries(WixDocument document, ITextFileReader reader)
 {
     activeDocument = document;
     project        = document.Project;
     textFileReader = reader;
 }
 protected override void AddFiles(WixProject project, string[] fileNames)
 {
     project.AddWixLibraries(fileNames);
 }
Exemplo n.º 56
0
 public WixDocument(WixProject project)
     : this(project, new DefaultFileLoader())
 {
 }