• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WixBinding.WixDocument类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICSharpCode.WixBinding.WixDocument的典型用法代码示例。如果您正苦于以下问题:C# WixDocument类的具体用法?C# WixDocument怎么用?C# WixDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WixDocument类属于ICSharpCode.WixBinding命名空间,在下文中一共展示了WixDocument类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			controlsAddedCount = 0;
			CreatedComponents.Clear();
			WixDialog wixDialog = doc.CreateWixDialog("AcceptLicenseDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				foreach (Control control in dialog.Controls) {
					++controlsAddedCount;
				}
				RadioButtonGroupBox radioButtonGroup = (RadioButtonGroupBox)dialog.Controls[0];
				radioButtonGroupName = radioButtonGroup.Name;
				radioButtonGroupPropertyName = radioButtonGroup.PropertyName;
				radioButtonGroupLocation = radioButtonGroup.Location;
				radioButtonGroupSize = radioButtonGroup.Size;
				
				RadioButton acceptRadioButton = (RadioButton)radioButtonGroup.Controls[0];
				acceptRadioButtonName = acceptRadioButton.Name;
				acceptRadioButtonLocation = acceptRadioButton.Location;
				acceptRadioButtonSize = acceptRadioButton.Size;
				
				RadioButton declineRadioButton = (RadioButton)radioButtonGroup.Controls[1];
				declineRadioButtonName = declineRadioButton.Name;
				declineRadioButtonLocation = declineRadioButton.Location;
				declineRadioButtonSize = declineRadioButton.Size;
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:28,代码来源:RadioButtonTestFixture.cs


示例2: Init

		public void Init()
		{
			doc = new WixDocument();
			doc.FileName = @"C:\Projects\Setup\Setup.wxs";
			doc.LoadXml(GetWixXml());
			component = (WixComponentElement)doc.SelectSingleNode("//w:Component", new WixNamespaceManager(doc.NameTable));
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:ExistingFileIdGenerationTests.cs


示例3: Init

		public void Init()
		{
			SD.InitializeForUnitTests();
			textEditor = new MockTextEditor();
			MockTextEditorViewContent viewContent = new MockTextEditorViewContent();
			viewContent.TextEditor = textEditor;
			viewContent.SetFileName(@"d:\projects\test\file.wxs");
			
			workbench = new MockWorkbench();
			workbench.ViewContentCollection.Add(viewContent);
			
			MockTextEditorOptions textEditorOptions = new MockTextEditorOptions();
			MockXmlTextWriter xmlTextWriter = new MockXmlTextWriter(textEditorOptions);
			WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
			document = new WixDocument(project, new DefaultFileLoader());
			document.LoadXml(GetWixXml());
			document.FileName = @"d:\projects\test\File.wxs";
			textEditor.Document.Text = GetWixXml();
			
			MockWixPackageFilesControl packageFilesControl = new MockWixPackageFilesControl();
			packageFilesView = new PackageFilesView(project, workbench, packageFilesControl, xmlTextWriter);
			
			packageFilesControl.IsDirty = true;
			AddNewChildElementsToDirectory();
			packageFilesView.Write(document);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:26,代码来源:UpdateRootDirectoryWithNewFilesTestFixtureBase.cs


示例4: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			controlsAddedCount = 0;
			CreatedComponents.Clear();
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				foreach (Control control in dialog.Controls) {
					++controlsAddedCount;
				}
				Button nextButton = (Button)dialog.Controls[0];
				nextButtonName = nextButton.Name;
				nextButtonLocation = nextButton.Location;
				nextButtonSize = nextButton.Size;
				nextButtonText = nextButton.Text;
				
				dialogAcceptButtonName = ((Button)dialog.AcceptButton).Name;
				
				Button cancelButton = (Button)dialog.Controls[1];
				cancelButtonName = cancelButton.Name;
				
				dialogCancelButtonName = ((Button)dialog.CancelButton).Name;
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:25,代码来源:ButtonsTestFixture.cs


示例5: SetUpFixture

		public void SetUpFixture()
		{
			BitmapFileNamesRequested.Clear();
			CreatedComponents.Clear();
			
			WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
			projectDirectory = p.Directory;
			p.Name = "MySetup";
			
			FileProjectItem item = new FileProjectItem(p, ItemType.Compile);
			item.Include = "Setup.wxs";
			string docFileName = item.FileName;
			ProjectService.AddProjectItem(p, item);
			
			item = new FileProjectItem(p, ItemType.Compile);
			item.Include = "Fragment.wxs";
			ProjectService.AddProjectItem(p, item);

			WixDocument doc = new WixDocument(p, this);
			doc.FileName = docFileName;
			doc.LoadXml(GetMainWixXml());
			
			WixDialog wixDialog = doc.GetDialog("WelcomeDialog", this);
			using (Form dialog = wixDialog.CreateDialog(this)) {
				PictureBox pictureBox = (PictureBox)dialog.Controls[0];
				hasImage = (pictureBox.Image != null);
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:28,代码来源:BitmapFromProjectTestFixture.cs


示例6: WixDialog

		/// <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);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:WixDialog.cs


示例7: SetUpFixture

		public void SetUpFixture()
		{			
			WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
			projectDirectory = p.Directory;
			p.Name = "MySetup";
			
			FileProjectItem item = new FileProjectItem(p, ItemType.Compile);
			item.Include = "Setup.wxs";
			string docFileName = item.FileName;
			ProjectService.AddProjectItem(p, item);
			
			item = new FileProjectItem(p, ItemType.Compile);
			item.Include = "InvalidXml.wxs";
			ProjectService.AddProjectItem(p, item);

			item = new FileProjectItem(p, ItemType.Compile);
			item.Include = "MissingFile.wxs";
			ProjectService.AddProjectItem(p, item);
			
			item = new FileProjectItem(p, ItemType.Compile);
			item.Include = "Fragment.wxs";
			ProjectService.AddProjectItem(p, item);

			WixDocument doc = new WixDocument(p);
			doc.FileName = docFileName;
			doc.LoadXml(GetMainWixXml());
			
			binaries = new WixBinaries(doc, this);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:29,代码来源:GetBinaryFileNameFromProjectTestFixture.cs


示例8: GetBinaryFileNameWhenWixDocNotInProject

		public void GetBinaryFileNameWhenWixDocNotInProject()
		{
			WixDocument doc = new WixDocument();
			WixBinaries binaries = new WixBinaries(doc, this);
			
			Assert.IsNull(binaries.GetBinaryFileName("UnknownId"));
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:GetBinaryFileNameFromProjectTestFixture.cs


示例9: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			CreatedComponents.Clear();
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {

				ListBox listBox = new ListBox();
				listBox.Name = "NewListBox";
				listBox.Items.Add("New item1");
				listBox.Items.Add("New item2");
				dialog.Controls.Add(listBox);
				
				XmlElement dialogElement = wixDialog.UpdateDialogElement(dialog);
				XmlElement controlElement = (XmlElement)dialogElement.ChildNodes[0];
				controlName = controlElement.GetAttribute("Id");
				controlType = controlElement.GetAttribute("Type");
				
				XmlElement listBoxElement = (XmlElement)controlElement.ChildNodes[0];
				
				listBoxItemCount = listBoxElement.ChildNodes.Count;
				XmlElement listBoxItem1Element = (XmlElement)listBoxElement.ChildNodes[0];
				listBoxItem1Text = listBoxItem1Element.GetAttribute("Text");
				XmlElement listBoxItem2Element = (XmlElement)listBoxElement.ChildNodes[1];
				listBoxItem2Text = listBoxItem2Element.GetAttribute("Text");
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:28,代码来源:ListBoxAddedTestFixture.cs


示例10: AddRootDirectory

		public void AddRootDirectory()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDirectoryElement element = doc.AddRootDirectory();
			Assert.IsNotNull(element);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:AddRootDirectoryWithNoProductElementTestFixture.cs


示例11: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			CreatedComponents.Clear();
			WixDialog wixDialog = doc.GetDialog("AcceptLicenseDialog");
			using (Form dialog = wixDialog.CreateDialog(this)) {

				RadioButtonGroupBox radioButtonGroup = (RadioButtonGroupBox)dialog.Controls[0];
				Label label1 = new Label();
				label1.Left = 100;
				label1.Top = 30;
				radioButtonGroup.Controls.Add(label1);
				radioButtonGroup.Controls.SetChildIndex(label1, 0);
			
				Label label2 = new Label();
				label2.Left = 100;
				label2.Top = 30;
				radioButtonGroup.Controls.Add(label2);
				
				// Add a panel to the dialog controls.
				Panel panel = new Panel();
				panel.Left = 100;
				panel.Top = 30;
				dialog.Controls.Add(panel);
								
				XmlElement dialogElement = wixDialog.UpdateDialogElement(dialog);
				XmlElement radioButtonGroupElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='Buttons']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				acceptRadioButtonElement = (XmlElement)radioButtonGroupElement.SelectSingleNode("//w:RadioButtonGroup/w:RadioButton", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				
				controlElementCount = dialogElement.SelectNodes("w:Control", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable)).Count;
				radioButtonElementCount = radioButtonGroupElement.SelectNodes("//w:RadioButtonGroup//w:RadioButton", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable)).Count;				
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:34,代码来源:NonRadioButtonAddedToGroupTestFixture.cs


示例12: SetupFixture

		public void SetupFixture()
		{
			SD.InitializeForUnitTests();
			doc = new WixDocument();
			doc.FileName = @"C:\Projects\Setup\Setup.wxs";
			doc.LoadXml("<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'/>");
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:7,代码来源:FileIdGenerationTests.cs


示例13: CreateRootDirectory

		/// <summary>
		/// Creates the directory element and sets its Id and SourceName.
		/// </summary>
		public static WixDirectoryElement CreateRootDirectory(WixDocument document)
		{
			WixDirectoryElement rootDirectory = new WixDirectoryElement(document);
			rootDirectory.Id = RootDirectoryId;
			rootDirectory.SourceName = "SourceDir";
			return rootDirectory;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:10,代码来源:WixDirectoryElement.cs


示例14: ShowFiles

		/// <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);
			}
		}
开发者ID:hefnerliu,项目名称:SharpDevelop,代码行数:35,代码来源:WixPackageFilesEditor.cs


示例15: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			CreatedComponents.Clear();
			WixDialog wixDialog = doc.CreateWixDialog("AcceptLicenseDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {

				Panel radioButtonGroup = (Panel)dialog.Controls[0];
				radioButtonGroup.Left = 30;
				radioButtonGroup.Top = 100;
				
				RadioButton acceptRadioButton = (RadioButton)radioButtonGroup.Controls[0];
				acceptRadioButton.Left = 0;
				acceptRadioButton.Top = 5;
				acceptRadioButton.Width = 100;
				acceptRadioButton.Height = 50;
				acceptRadioButton.Text = "Accept";

				RadioButton declineRadioButton = (RadioButton)radioButtonGroup.Controls[1];
				declineRadioButton.Left = 10;
				declineRadioButton.Top = 20;
				declineRadioButton.Width = 200;
				declineRadioButton.Height = 30;
				declineRadioButton.Text = String.Empty;
				
				XmlElement dialogElement = wixDialog.UpdateDialogElement(dialog);
				radioButtonGroupElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='Buttons']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				
				XmlNodeList radioButtonElements = radioButtonGroupElement.SelectNodes("//w:RadioButtonGroup/w:RadioButton", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				acceptRadioButtonElement = (XmlElement)radioButtonElements[0];
				declineRadioButtonElement = (XmlElement)radioButtonElements[1];
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:34,代码来源:RadioButtonGroupChangedTestFixture.cs


示例16: GenerateIdFromFileName

		/// <summary>
		/// Creates an id from the filename.
		/// </summary>
		/// <remarks>
		/// Takes the filename, removes all periods, and 
		/// capitalises the first character and first extension character.
		/// </remarks>
		/// <param name="document">The Wix document is used to make sure the
		/// id generated is unique for that document.</param>
		/// <param name="fileName">The full filename including the directory to
		/// use when generating the id.</param>
		public static string GenerateIdFromFileName(WixDocument document, string fileName)
		{
			string id = GenerateIdFromFileName(fileName);
			if (!document.ComponentIdExists(id)) {
				return id;
			}
			
			// Add the parent folder to the id.
			string parentDirectory = WixDirectoryElement.GetLastDirectoryName(Path.GetDirectoryName(fileName));
			parentDirectory = FirstCharacterToUpperInvariant(parentDirectory);
			parentDirectory = WixFileElement.GenerateId(parentDirectory).Replace(".", String.Empty);
			id = String.Concat(parentDirectory, id);
			if (!document.ComponentIdExists(id)) {
				return id;
			}
			
			// Add a number to the end until we generate a unique id.
			int count = 0;
			string baseId = id;
			do {
				++count;
				id = String.Concat(baseId, count);
			} while (document.ComponentIdExists(id));
			
			return id;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:37,代码来源:WixComponentElement.cs


示例17: SetUpFixture

		public void SetUpFixture()
		{
			doc = new WixDocument();
			prefixBeforeLoad = doc.WixNamespacePrefix;
			doc.LoadXml(GetWixXml());
			directory = doc.CreateWixElement("Directory");
			directory.OwnerDocument.DocumentElement.AppendChild(directory);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:WixDocumentWithNamespacePrefixTestFixture.cs


示例18: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixComponentElement wixComponent = new WixComponentElement(doc);
			wixComponent.GenerateUniqueIdFromFileName(@"C:\Projects\My.Project\MyApp.exe");
			id = wixComponent.Id;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:GenerateComponentIdFromDirectoryWithDotsTestFixture.cs


示例19: WixPackageFilesEditor

		/// <summary>
		/// Creates a new instance of the WixPackageFilesEditor.
		/// </summary>
		/// <param name="view">The UI for the package files editor.</param>
		/// <param name="fileReader">The file reader hides the file system and the
		/// workbench from the editor so the class can be easily tested.</param>
		/// <param name="documentWriter">The file writer hides the file system and the
		/// workbench from the editor.</param>
		/// <param name="directoryReader">The directory reader hides the file system
		/// from the editor.</param>
		public WixPackageFilesEditor(IWixPackageFilesView view, ITextFileReader fileReader, IWixDocumentWriter documentWriter, IDirectoryReader directoryReader)
		{
			document = null;
			this.view = view;
			this.fileReader = fileReader;
			this.documentWriter = documentWriter;
			this.directoryReader = directoryReader;
		}
开发者ID:hefnerliu,项目名称:SharpDevelop,代码行数:18,代码来源:WixPackageFilesEditor.cs


示例20: SetUpFixture

		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			
			WixFileElement fileElement = new WixFileElement(doc);
			fileElement.FileName = @"MyApp.exe";
			fileNameSpecifiedNode = new WixFileTreeNode(fileElement);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:WixFileTreeNodeTestFixture.cs



注:本文中的ICSharpCode.WixBinding.WixDocument类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XamlDom.XamlObject类代码示例发布时间:2022-05-26
下一篇:
C# UnitTesting.SelectedTests类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap