Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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)));
                        }
                    }
                }
            }
        }