예제 #1
0
		/// <summary>
		/// Creates a new instance of the Wix Dialog class.
		/// </summary>
		/// <param name="dialogElement">The dialog XML element loaded from
		/// the Wix document</param>
		public WixDialog(WixDocument document, XmlElement dialogElement, WixBinaries binaries)
		{
			this.document = document;
			this.dialogElement = dialogElement;
			this.binaries = binaries;
			namespaceManager = new WixNamespaceManager(dialogElement.OwnerDocument.NameTable);
		}
예제 #2
0
 /// <summary>
 /// Creates a new instance of the Wix Dialog class.
 /// </summary>
 /// <param name="dialogElement">The dialog XML element loaded from
 /// the Wix document</param>
 public WixDialog(WixDocument document, XmlElement dialogElement, WixBinaries binaries)
 {
     this.document      = document;
     this.dialogElement = dialogElement;
     this.binaries      = binaries;
     namespaceManager   = new WixNamespaceManager(dialogElement.OwnerDocument.NameTable);
 }
		public void UpdateDialogElement_GetIconControl_IconControlStillExists()
		{
			var namespaceManager = new WixNamespaceManager(dialogElement.OwnerDocument.NameTable);
			var control = dialogElement.SelectSingleNode("w:Control", namespaceManager) as XmlElement;
			string id = control.GetAttribute("Id");
			
			Assert.AreEqual("MyIcon", id);
		}
예제 #4
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);
 }
예제 #5
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);			
		}
		public void Init()
		{
			base.InitFixture();
			editor.AddDirectory(directory);
			
			nsManager = new WixNamespaceManager(editor.Document.NameTable);
			appDirectoryElement = (WixDirectoryElement)editor.Document.GetRootDirectory().SelectSingleNode("w:Directory[@Name='MyApp']", nsManager);
			readmeComponentElement = (WixComponentElement)appDirectoryElement.SelectSingleNode("w:Component[w:File/@Name='readme.txt']", nsManager);
			licenseComponentElement = (WixComponentElement)appDirectoryElement.SelectSingleNode("w:Component[w:File/@Name='license.txt']", nsManager);	
			exeComponentElement = (WixComponentElement)appDirectoryElement.SelectSingleNode("w:Component[w:File/@Name='MyApp.exe']", nsManager);
		}
		public void SetUpFixture()
		{
			base.InitFixture();
			editor.ExcludedItems.AddRange(new string[] {"readme.txt", "obj"});
			editor.AddDirectory(directory);
			
			WixNamespaceManager nsManager = new WixNamespaceManager(editor.Document.NameTable);
			appDirectoryElement = (WixDirectoryElement)editor.Document.GetRootDirectory().FirstChild;
			docsDirectoryElement = (WixDirectoryElement)appDirectoryElement.SelectSingleNode("w:Directory[@Name='docs']", nsManager);
			srcDirectoryElement = (WixDirectoryElement)appDirectoryElement.SelectSingleNode("w:Directory[@Name='src']", nsManager);
			readmeFileElement = (WixFileElement)docsDirectoryElement.SelectSingleNode("w:Component/w:File[@Name='readme.txt']", nsManager);
		}
		public void SetUpFixture()
		{
			base.InitFixture();
			editor.AddDirectory(directory);
			
			WixNamespaceManager nsManager = new WixNamespaceManager(editor.Document.NameTable);
			appDirectoryElement = (WixDirectoryElement)editor.Document.GetRootDirectory().FirstChild;
			myAppExeFileComponentElement = (WixComponentElement)appDirectoryElement.SelectSingleNode("w:Component", nsManager);
			myAppExeFileElement = (WixFileElement)myAppExeFileComponentElement.LastChild;
			docsDirectoryElement = (WixDirectoryElement)appDirectoryElement.SelectSingleNode("w:Directory[@Name='docs']", nsManager);
			srcDirectoryElement = (WixDirectoryElement)appDirectoryElement.SelectSingleNode("w:Directory[@Name='src']", nsManager);
			cssDirectoryElement = (docsDirectoryElement.GetDirectories())[0];
			readmeFileElement = (WixFileElement)docsDirectoryElement.SelectSingleNode("w:Component/w:File[@Name='readme.txt']", nsManager);
		}