public void SetUpFixture()
		{
			SD.InitializeForUnitTests();
			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.CreateWixDialog("WelcomeDialog", this);
			using (Form dialog = wixDialog.CreateDialog(this)) {
				PictureBox pictureBox = (PictureBox)dialog.Controls[0];
				hasImage = (pictureBox.Image != null);
			}
		}
		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;
			}
		}
		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];
			}
		}
		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)) {

				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;				
			}
		}
		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");
			}
		}
        void GetDialogElement()
        {
            WixDocument document = CreateWixDocument();

            document.LoadXml(designer.GetDocumentXml());
            wixDialog = document.CreateWixDialog(designer.DialogId, new WorkbenchTextFileReader());
        }
		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;
			}
		}
		public void CreateDialog()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form simpleDialog = wixDialog.CreateDialog()) {
				minimizeBox = simpleDialog.MinimizeBox;
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog()) {
				dialogTitle = dialog.Text;
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Button backButton = (Button)dialog.Controls[0];
				disabled = !backButton.Enabled;
			}
		}
		public void UpdateDialogElement()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			CreatedComponents.Clear();
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				XmlElement dialogElement = wixDialog.UpdateDialogElement(dialog);
			}
		}
		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)) {
				formComponent = CreatedComponents[0];
				formName = dialog.Name;
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());

			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog()) {
				dialog.MinimizeBox = true;
				dialogElement = wixDialog.UpdateDialogElement(dialog);
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Button button = (Button)dialog.Controls[0];
				fontName = button.Font.Name;
				fontSize = button.Font.Size;
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());

			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog()) {
				dialog.Text = "New dialog title";
				dialog.ClientSize = new Size(200, 100);
				dialogElement = wixDialog.UpdateDialogElement(dialog);
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Button nextButton = (Button)dialog.Controls[0];
				nextButtonText = nextButton.Text;			
				Button cancelButton = (Button)dialog.Controls[1];
				cancelButtonText = cancelButton.Text;
			}
		}
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				TreeView treeView = (TreeView)dialog.Controls[0];
				name = treeView.Name;
				location = treeView.Location;
				size = treeView.Size;
			}
		}
		public void CreateDialog()
		{
			WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
			WixDocument doc = new WixDocument(project);
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			try {
				wixDialog.CreateDialog(null);
				Assert.Fail("Expected an ArgumentException");
			} catch (ArgumentException ex) {
				Assert.AreEqual("componentCreator", ex.ParamName);
			}
		}
		public void SetUpFixture()
		{
			doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form simpleDialog = wixDialog.CreateDialog()) {
				dialogName = simpleDialog.Name;
				borderStyle = simpleDialog.FormBorderStyle;
				clientSize = simpleDialog.ClientSize;
				minimizeBox = simpleDialog.MinimizeBox;
				maximizeBox = simpleDialog.MaximizeBox;
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());

			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog()) {
				Button nextButton = (Button)dialog.Controls[0];
				dialog.Controls.Remove(nextButton);
				dialogElement = wixDialog.UpdateDialogElement(dialog);
				nextButtonElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='Next']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));				
			}
		}
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				MaskedTextBox textBox = (MaskedTextBox)dialog.Controls[0];
				name = textBox.Name;
				text = textBox.Text;
				location = textBox.Location;
				size = textBox.Size;
			}
		}
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Label titleLabel = (Label)dialog.Controls[0];
				titleLabelColor = titleLabel.BackColor;
				
				Label descriptionLabel = (Label)dialog.Controls[1];
				descriptionLabelColor = descriptionLabel.BackColor;
			}
		}
示例#24
0
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Label line = (Label)dialog.Controls[0];
				lineName = line.Name;
				lineLocation = line.Location;
				lineBorder = line.BorderStyle;
				lineSize = line.Size;
			}
		}
		public void SetUpFixture()
		{
			BitmapFileNamesRequested.Clear();
			CreatedComponents.Clear();
			WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
			WixDocument doc = new WixDocument(project, this);
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				PictureBox pictureBox = (PictureBox)dialog.Controls[0];
				hasImage = (pictureBox.Image != null);
				sizeMode = pictureBox.SizeMode;
			}
		}
示例#26
0
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Label label = (Label)dialog.Controls[0];
				labelName = label.Name;
				labelText = label.Text;
				labelLocation = label.Location;
				labelSize = label.Size;
				labelFontName = label.Font.Name;
				labelFontSize = label.Font.Size;
				labelFontBold = label.Font.Bold;
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				Label titleLabel = (Label)dialog.Controls[0];
				titleLabelFontName = titleLabel.Font.Name;
				titleLabelFontSize = titleLabel.Font.Size;
				titleLabelFontBold = titleLabel.Font.Bold;
				
				Label descLabel = (Label)dialog.Controls[1];
				descLabelFontName = descLabel.Font.Name;
				descLabelFontSize = descLabel.Font.Size;
				descLabelFontBold = descLabel.Font.Bold;
			}
		}
		public void SetUpFixture()
		{
			CreatedComponents.Clear();
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				ListBox listBox = (ListBox)dialog.Controls[0];
				name = listBox.Name;
				location = listBox.Location;
				size = listBox.Size;
				
				// List items.
				listItemCount = listBox.Items.Count;
				listItem1Text = (string)listBox.Items[0];
				listItem2Text = (string)listBox.Items[1];
			}
		}
		public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());

			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog()) {
				GroupBox groupBox = new GroupBox();
				groupBox.Name = "NewGroupBox";
				groupBox.Top = 10;
				groupBox.Left = 20;
				dialog.Controls.Add(groupBox);
				
				TextBox textBox = new TextBox();
				textBox.Name = "NewTextBox";
				groupBox.Controls.Add(textBox);
				
				Button button = new Button();
				button.Name = "NewButton";
				groupBox.Controls.Add(button);
				
				GroupBox childGroupBox = new GroupBox();
				childGroupBox.Top = 10;
				childGroupBox.Left = 20;
				childGroupBox.Name = "NewChildGroupBox";
				groupBox.Controls.Add(childGroupBox);
				
				RadioButtonGroupBox radioButtonGroupBox = new RadioButtonGroupBox();
				radioButtonGroupBox.Name = "NewRadioButtonGroupBox";
				groupBox.Controls.Add(radioButtonGroupBox);
				
				Button childButton = new Button();
				childButton.Name = "NewChildButton";
				childGroupBox.Controls.Add(childButton);
				
				dialogElement = wixDialog.UpdateDialogElement(dialog);
				groupBoxElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='NewGroupBox']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));				
				textBoxElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='NewTextBox']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				childGroupBoxElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='NewChildGroupBox']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));				
				buttonElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='NewButton']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				radioButtonGroupElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='NewRadioButtonGroupBox']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				childButtonElement = (XmlElement)dialogElement.SelectSingleNode("w:Control[@Id='NewChildButton']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
			}
		}
		public void SetUpFixture()
		{
			BitmapFileNamesRequested.Clear();
			WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
			WixDocument doc = new WixDocument(project, this);
			doc.LoadXml(GetWixXml());
			WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
			using (Form dialog = wixDialog.CreateDialog(this)) {
				// Should be the last control added to the dialog appears behind all 
				// the other controls. This is what happens when you call SendToBack 
				// on a control.
				PictureBox pictureBox = (PictureBox)dialog.Controls[dialog.Controls.Count - 1];
				name = pictureBox.Name;
				text = pictureBox.Text;
				location = pictureBox.Location;
				size = pictureBox.Size;
				hasImage = (pictureBox.Image != null);
			}
		}
		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)) {

				ListView listView = (ListView)dialog.Controls[0];
				listView.Items.RemoveAt(0);
			
				XmlElement dialogElement = wixDialog.UpdateDialogElement(dialog);
				XmlElement listViewElement = (XmlElement)dialogElement.SelectSingleNode("//w:ListView[@Property='ListViewProperty']", new WixNamespaceManager(dialogElement.OwnerDocument.NameTable));
				itemCount = listViewElement.ChildNodes.Count;
				
				XmlElement item1Element = (XmlElement)listViewElement.ChildNodes[0];
				item1Text = item1Element.GetAttribute("Text");
			}
		}