private void CloseWxsFile() { if (oldTabIndex >= 0 && oldTabIndex < panels.Length && panels[oldTabIndex].Menu != null) { mainMenu.MenuItems.RemoveAt(2); } buildWixCompile.Enabled = false; buildWixInstall.Enabled = false; buildWixUninstall.Enabled = false; buildProjectSettings.Enabled = false; if (tabButtonControl != null) { mainPanel.Controls.Remove(tabButtonControl); tabButtonControl.Visible = false; tabButtonControl = null; } oldTabIndex = -1; panels = new BasePanel[panelCount]; if (editUIPanel != null) { editUIPanel.Visible = false; editUIPanel.CloseCurrentDialog(); editUIPanel = null; } if (editPropertiesPanel != null) { editPropertiesPanel.Visible = false; editPropertiesPanel = null; } if (editResourcesPanel != null) { editResourcesPanel.Visible = false; editResourcesPanel = null; } if (editInstallDataPanel != null) { editInstallDataPanel.Visible = false; editInstallDataPanel = null; } if (editGlobalDataPanel != null) { editGlobalDataPanel.Visible = false; editGlobalDataPanel = null; } if (editActionsPanel != null) { editActionsPanel.Visible = false; editActionsPanel = null; } if (editCustomTablePanel != null) { editCustomTablePanel.Visible = false; editCustomTablePanel = null; } if (wixFiles != null) { wixFiles.Dispose(); wixFiles = null; } fileClose.Enabled = false; Text = "WiX Edit"; fileSave.Enabled = false; fileSaveAs.Enabled = false; searchPanel.Clear(); }
private void LoadWxsFile(WixFiles newWixFiles) { if (wixFiles != null) { wixFiles.Dispose(); wixFiles = null; } wixFiles = newWixFiles; wixFiles.wxsChanged += new EventHandler(wixFiles_wxsChanged); tabButtonControl = new TabButtonControl(); tabButtonControl.Dock = DockStyle.Fill; mainPanel.Controls.Add(tabButtonControl); tabButtonControl.Visible = false; tabButtonControl.TabChange += new EventHandler(OnTabChanged); tabButtonControl.Visible = true; // Add Global tab editGlobalDataPanel = new EditGlobalDataPanel(wixFiles, new VoidVoidDelegate(ReloadAll)); editGlobalDataPanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Global", editGlobalDataPanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.global.png"))); panels[0] = editGlobalDataPanel; oldTabIndex = 0; // Add Files tab editInstallDataPanel = new EditInstallDataPanel(wixFiles); editInstallDataPanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Files", editInstallDataPanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.files.png"))); panels[1] = editInstallDataPanel; if (editInstallDataPanel.Menu != null) { mainMenu.MenuItems.Add(2, editInstallDataPanel.Menu); } // Add properties tab editPropertiesPanel = new EditPropertiesPanel(wixFiles); editPropertiesPanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Properties", editPropertiesPanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.properties.png"))); panels[2] = editPropertiesPanel; // Add dialog tab editUIPanel = new EditUIPanel(wixFiles); editUIPanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Dialogs", editUIPanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.dialogs.png"))); panels[3] = editUIPanel; // Add Resources tab editResourcesPanel = new EditResourcesPanel(wixFiles); editResourcesPanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Resources", editResourcesPanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.resources.png"))); panels[4] = editResourcesPanel; // Add Resources tab editActionsPanel = new EditActionsPanel(wixFiles); editActionsPanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Actions", editActionsPanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.actions.png"))); panels[5] = editActionsPanel; // Add CustomTable tab editCustomTablePanel = new EditCustomTablePanel(wixFiles); editCustomTablePanel.Dock = DockStyle.Fill; tabButtonControl.AddTab("Tables", editCustomTablePanel, new Bitmap(WixFiles.GetResourceStream("tabbuttons.customtables.png"))); panels[6] = editCustomTablePanel; // Update menu fileClose.Enabled = true; UpdateTitlebar(); fileSave.Enabled = true; fileSaveAs.Enabled = true; buildWixCompile.Enabled = true; buildWixInstall.Enabled = true; buildWixUninstall.Enabled = true; buildProjectSettings.Enabled = true; }