protected override void UpdateWizardContent(XenTabPage page) { Type type = page.GetType(); if (type == typeof(ImportSourcePage)) { #region ImportSourcePage var oldTypeOfImport = m_typeOfImport; //store previous type m_typeOfImport = m_pageImportSource.TypeOfImport; var appliancePages = new XenTabPage[] { m_pageEula, m_pageHost, m_pageStorage, m_pageNetwork, m_pageSecurity, m_pageOptions }; var imagePages = new XenTabPage[] { m_pageVMconfig, m_pageHost, m_pageStorage, m_pageNetwork, m_pageOptions }; var xvaPages = new XenTabPage[] { m_pageXvaHost, m_pageXvaStorage, m_pageXvaNetwork }; switch (m_typeOfImport) { case ImportType.Ovf: if (oldTypeOfImport != ImportType.Ovf) { Text = Messages.WIZARD_TEXT_IMPORT_OVF; pictureBoxWizard.Image = Images.StaticImages._000_ImportVirtualAppliance_h32bit_32; RemovePages(imagePages); RemovePage(m_pageBootOptions); RemovePages(xvaPages); AddAfterPage(m_pageImportSource, appliancePages); } m_pageEula.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfPackage.OvfEnvelope; m_pageSecurity.SelectedOvfPackage = m_pageImportSource.SelectedOvfPackage; CheckDisabledPages(m_pageEula, m_pageSecurity); //decide whether to disable these progress steps ResetVmMappings(m_pageImportSource.SelectedOvfPackage.OvfEnvelope); m_pageHost.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfPackage.OvfEnvelope; m_pageHost.SetDefaultTarget(m_pageHost.ChosenItem ?? m_selectedObject); m_pageHost.VmMappings = m_vmMappings; m_pageStorage.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfPackage.OvfEnvelope; lunPerVdiMappingPage.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfPackage.OvfEnvelope; m_pageNetwork.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfPackage.OvfEnvelope; NotifyNextPagesOfChange(m_pageEula, m_pageHost, m_pageStorage, m_pageNetwork, m_pageSecurity, m_pageOptions); break; case ImportType.Vhd: if (oldTypeOfImport != ImportType.Vhd) { Text = Messages.WIZARD_TEXT_IMPORT_VHD; pictureBoxWizard.Image = Images.StaticImages._000_ImportVM_h32bit_32; RemovePages(appliancePages); RemovePages(xvaPages); AddAfterPage(m_pageImportSource, imagePages); } m_pageVMconfig.IsWim = m_pageImportSource.IsWIM; m_pageHost.SetDefaultTarget(m_pageHost.ChosenItem ?? m_selectedObject); m_pageHost.SelectedOvfEnvelope = null; m_pageHost.VmMappings = m_vmMappings; NotifyNextPagesOfChange(m_pageVMconfig, m_pageHost, m_pageStorage, m_pageNetwork, m_pageOptions); break; case ImportType.Xva: if (oldTypeOfImport != ImportType.Xva) { Text = Messages.WIZARD_TEXT_IMPORT_XVA; pictureBoxWizard.Image = Images.StaticImages._000_ImportVM_h32bit_32; RemovePages(imagePages); RemovePage(m_pageBootOptions); RemovePages(appliancePages); AddAfterPage(m_pageImportSource, xvaPages); } m_pageXvaHost.SetDefaultTarget(m_selectedObject); m_pageXvaStorage.FilePath = m_pageImportSource.FilePath; break; } #endregion } else if (type == typeof(ImageVMConfigPage)) { //then use it to create an ovf for the import m_envelopeFromVhd = OVF.CreateOvfEnvelope(m_pageVMconfig.VmName, m_pageVMconfig.CpuCount, m_pageVMconfig.Memory, m_pageBootOptions.BootParams, m_pageBootOptions.PlatformSettings, m_pageImportSource.DiskCapacity, m_pageImportSource.IsWIM, m_pageVMconfig.AdditionalSpace, m_pageImportSource.FilePath, m_pageImportSource.ImageLength); m_pageStorage.SelectedOvfEnvelope = m_envelopeFromVhd; lunPerVdiMappingPage.SelectedOvfEnvelope = m_envelopeFromVhd; m_pageNetwork.SelectedOvfEnvelope = m_envelopeFromVhd; ResetVmMappings(m_envelopeFromVhd); NotifyNextPagesOfChange(m_pageHost, m_pageStorage, m_pageNetwork); } else if (type == typeof(ImportSelectHostPage)) { TargetConnection = m_pageHost.ChosenItem == null ? null : m_pageHost.ChosenItem.Connection; RemovePage(m_pageRbac); ConfigureRbacPage(TargetConnection); m_vmMappings = m_pageHost.VmMappings; m_pageStorage.VmMappings = m_vmMappings; m_pageStorage.Connection = TargetConnection; m_pageNetwork.Connection = TargetConnection; m_pageOptions.Connection = TargetConnection; RemovePage(m_pageBootOptions); if (m_typeOfImport == ImportType.Vhd && BootModesControl.ShowBootModeOptions(TargetConnection)) { AddAfterPage(m_pageNetwork, m_pageBootOptions); m_pageBootOptions.Connection = TargetConnection; } m_pageBootOptions.Connection = TargetConnection; NotifyNextPagesOfChange(m_pageStorage, m_pageNetwork, m_pageOptions); } else if (type == typeof(ImportSelectStoragePage)) { RemovePage(lunPerVdiMappingPage); lunPerVdiMappingPage.ClearPickerData(); m_vmMappings = m_pageStorage.VmMappings; m_pageNetwork.VmMappings = m_vmMappings; lunPerVdiMappingPage.VmMappings = m_vmMappings; if (lunPerVdiMappingPage.IsAnyPickerDataMappable && lunPerVdiMappingPage.MapLunsToVdisRequired && m_typeOfImport == ImportType.Ovf) { AddAfterPage(m_pageStorage, lunPerVdiMappingPage); } } else if (type == typeof(LunPerVdiImportPage)) { m_vmMappings = lunPerVdiMappingPage.VmMappings; m_pageNetwork.VmMappings = m_vmMappings; } else if (type == typeof(ImportSelectNetworkPage)) { m_vmMappings = m_pageNetwork.VmMappings; m_pageOptions.VmMappings = m_vmMappings; } else if (type == typeof(GlobalSelectHost)) { var con = m_pageXvaHost.SelectedHost == null ? m_pageXvaHost.SelectedConnection : m_pageXvaHost.SelectedHost.Connection; RemovePage(m_pageRbac); ConfigureRbacPage(con); m_pageXvaStorage.SetConnection(con); m_pageXvaStorage.SetTargetHost(m_ignoreAffinitySet ? null : m_pageXvaHost.SelectedHost); m_pageXvaNetwork.SetConnection(con); m_pageXvaNetwork.SetAffinity(m_pageXvaHost.SelectedHost); NotifyNextPagesOfChange(m_pageXvaStorage, m_pageXvaNetwork); } else if (type == typeof(StoragePickerPage)) { m_pageFinish.ShowStartVmsGroupBox = m_pageXvaStorage.ImportedVm != null && !m_pageXvaStorage.ImportedVm.is_a_template; m_pageXvaNetwork.SetVm(m_pageXvaStorage.ImportedVm); NotifyNextPagesOfChange(m_pageXvaNetwork); } if (type != typeof(ImportFinishPage)) { NotifyNextPagesOfChange(m_pageFinish); } }