private static void ProcessLegacySkin(string skinFolder, string skinType) { string skinName = Path.GetFileName(skinFolder); if (skinName != "_default") { SkinPackageInfo skin = new SkinPackageInfo(); skin.SkinName = skinName; skin.SkinType = skinType; PackageInfo package = CreateSkinPackage(skin); SkinPackageWriter skinWriter = new SkinPackageWriter(skin, package); skinWriter.GetFiles(false); package.Manifest = skinWriter.WriteManifest(true); CommonLibrary.Services.Installer.Packages.PackageController.SavePackage(package); skin.PackageID = package.PackageID; skin.SkinPackageID = SkinController.AddSkinPackage(skin); foreach (InstallFile skinFile in skinWriter.Files.Values) { if (skinFile.Type == InstallFileType.Ascx) { if (skinType == "Skin") { SkinController.AddSkin(skin.SkinPackageID, Path.Combine("[G]" + SkinController.RootSkin, Path.Combine(skin.SkinName, skinFile.FullName))); } else { SkinController.AddSkin(skin.SkinPackageID, Path.Combine("[G]" + SkinController.RootContainer, Path.Combine(skin.SkinName, skinFile.FullName))); } } } } }
public static PackageWriterBase GetWriter(PackageInfo package) { PackageWriterBase writer = null; switch (package.PackageType) { case "Auth_System": writer = new AuthenticationPackageWriter(package); break; case "Module": writer = new ModulePackageWriter(package); break; case "Container": writer = new ContainerPackageWriter(package); break; case "Skin": writer = new SkinPackageWriter(package); break; case "CoreLanguagePack": case "ExtensionLanguagePack": writer = new LanguagePackWriter(package); break; case "SkinObject": writer = new SkinControlPackageWriter(package); break; case "Provider": writer = new ProviderPackageWriter(package); break; case "Library": writer = new LibraryPackageWriter(package); break; case "Widget": writer = new WidgetPackageWriter(package); break; default: CommonLibrary.Common.Lists.ListController listController = new CommonLibrary.Common.Lists.ListController(); ListEntryInfo entry = listController.GetListEntryInfo("PackageWriter", package.PackageType); if (entry != null && !string.IsNullOrEmpty(entry.Text)) { writer = (PackageWriterBase)Reflection.CreateObject(entry.Text, "PackageWriter_" + entry.Value); } break; } return(writer); }
private static void CreateSkinManifest(XmlWriter writer, string skinFolder, string skinType, string tempInstallFolder, string subFolder) { string skinName = Path.GetFileNameWithoutExtension(skinFolder); SkinPackageInfo skin = new SkinPackageInfo(); skin.SkinName = skinName; skin.SkinType = skinType; PackageInfo package = CreateSkinPackage(skin); SkinPackageWriter skinWriter = new SkinPackageWriter(skin, package, tempInstallFolder, subFolder); skinWriter.GetFiles(false); skinWriter.SetBasePath(); skinWriter.WriteManifest(writer, true); }
private static void ProcessLegacySkin(string skinFolder, string skinType) { string skinName = Path.GetFileName(skinFolder); if (skinName != "_default") { var skin = new SkinPackageInfo(); skin.SkinName = skinName; skin.SkinType = skinType; //Create a Package PackageInfo package = CreateSkinPackage(skin); //Create a SkinPackageWriter var skinWriter = new SkinPackageWriter(skin, package); skinWriter.GetFiles(false); //Save the manifest package.Manifest = skinWriter.WriteManifest(true); //Save Package PackageController.Instance.SaveExtensionPackage(package); //Update Skin Package with new PackageID skin.PackageID = package.PackageID; //Save Skin Package skin.SkinPackageID = SkinController.AddSkinPackage(skin); foreach (InstallFile skinFile in skinWriter.Files.Values) { if (skinFile.Type == InstallFileType.Ascx) { if (skinType == "Skin") { SkinController.AddSkin(skin.SkinPackageID, Path.Combine("[G]" + SkinController.RootSkin, Path.Combine(skin.SkinName, skinFile.FullName))); } else { SkinController.AddSkin(skin.SkinPackageID, Path.Combine("[G]" + SkinController.RootContainer, Path.Combine(skin.SkinName, skinFile.FullName))); } } } } }
private static void CreateSkinManifest(XmlWriter writer, string skinFolder, string skinType, string tempInstallFolder, string subFolder) { string skinName = Path.GetFileNameWithoutExtension(skinFolder); var skin = new SkinPackageInfo(); skin.SkinName = skinName; skin.SkinType = skinType; //Create a Package PackageInfo package = CreateSkinPackage(skin); //Create a SkinPackageWriter var skinWriter = new SkinPackageWriter(skin, package, tempInstallFolder, subFolder); skinWriter.GetFiles(false); //We need to reset the BasePath so it using the correct basePath rather than the Temp InstallFolder skinWriter.SetBasePath(); //Writer package manifest fragment to writer skinWriter.WriteManifest(writer, true); }