private void BindPackageEditor() { phEditor.Controls.Clear(); if (PackageEditor != null) { PackageEditor.PackageID = PackageID; PackageEditor.Initialize(); PackageEditor.IsWizard = true; phEditor.Controls.Add(PackageEditor as Control); var moduleControl = PackageEditor as IModuleControl; if (moduleControl != null) { moduleControl.ModuleContext.Configuration = ModuleContext.Configuration; } } }
private void BindData() { email.ValidationExpression = Globals.glbEmailRegEx; trLanguagePackType.Visible = false; switch (Mode) { case "All": lblHelp.Text = Localization.GetString("EditHelp", LocalResourceFile); cmdUpdate.Text = Localization.GetString("cmdUpdate", LocalResourceFile); break; case "LanguagePack": lblHelp.Text = Localization.GetString("EditLanguageHelp", LocalResourceFile); cmdUpdate.Text = Localization.GetString("cmdUpdateLanguage", LocalResourceFile); break; case "Module": lblHelp.Text = Localization.GetString("EditModuleHelp", LocalResourceFile); cmdUpdate.Text = Localization.GetString("cmdUpdateModule", LocalResourceFile); break; case "Skin": lblHelp.Text = Localization.GetString("EditSkinHelp", LocalResourceFile); cmdUpdate.Text = Localization.GetString("cmdUpdateSkin", LocalResourceFile); break; } cmdPackage.Visible = IsSuperTab; cmdUpdate.Visible = IsSuperTab; if (Package != null) { if (PackageEditor == null || PackageID == Null.NullInteger) { extensionSection.Visible = false; } else { phEditor.Controls.Clear(); phEditor.Controls.Add(PackageEditor as Control); var moduleControl = PackageEditor as IModuleControl; if (moduleControl != null) { moduleControl.ModuleContext.Configuration = ModuleContext.Configuration; } PackageEditor.PackageID = PackageID; PackageEditor.Initialize(); Package.IconFile = Util.ParsePackageIconFileName(Package); } switch (Package.PackageType) { case "Auth_System": case "Container": case "Module": case "Skin": iconFile.Enabled = true; Package.IconFile = Util.ParsePackageIconFileName(Package); break; default: iconFile.Enabled = false; Package.IconFile = "Not Available"; break; } if (Mode != "All") { packageType.Visible = false; } //Determine if Package is ready for packaging PackageWriterBase writer = PackageWriterFactory.GetWriter(Package); cmdPackage.Visible = IsSuperTab && writer != null && Directory.Exists(Path.Combine(Globals.ApplicationMapPath, writer.BasePath)); cmdDelete.Visible = IsSuperTab && (!Package.IsSystemPackage) && (PackageController.CanDeletePackage(Package, ModuleContext.PortalSettings)); ctlAudit.Entity = Package; packageForm.DataSource = Package; packageFormReadOnly.DataSource = Package; if (!Page.IsPostBack) { packageForm.DataBind(); packageFormReadOnly.DataBind(); } packageForm.Visible = IsSuperTab; packageFormReadOnly.Visible = !IsSuperTab; } }