示例#1
0
        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);
            }
        }
示例#2
0
        public void SetUpFixture()
        {
            BitmapFileNamesRequested.Clear();
            CreatedComponents.Clear();
            WixProject  project = WixBindingTestsHelper.CreateEmptyWixProject();
            WixDocument doc     = new WixDocument(project, this);

            doc.LoadXml(GetWixXml());
            WixDialog wixDialog = doc.GetDialog("WelcomeDialog");

            using (Form dialog = wixDialog.CreateDialog(this)) {
                PictureBox pictureBox = (PictureBox)dialog.Controls[0];
                hasImage = (pictureBox.Image != null);
                sizeMode = pictureBox.SizeMode;
            }
        }
示例#3
0
        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);
            }
        }