Ejemplo n.º 1
0
        public static void ActivateAsCurrentSkin(int template, string skinAlias)
        {
            //lookup template in skinning.config
            string currentSkin = GetCurrentSkinAlias(template);

            //if different from current, and the template is skinned
            if (currentSkin != skinAlias)
            {
                //this will restore the files to the standard runway, as they looked before the skin was applied
                if (currentSkin != string.Empty)
                {
                    RollbackSkin(template);
                }

                Skin newSkin = Skin.CreateFromAlias(skinAlias);

                if (newSkin.OverridesTemplates())
                {
                    newSkin.DeployTemplateFiles();
                }

                SetSkin(template, skinAlias);

                newSkin.ExecuteInstallTasks();

                Save();
            }
        }
Ejemplo n.º 2
0
        public static void RollbackSkin(int template)
        {
            string currentSkin = GetCurrentSkinAlias(template);
            Skin   skin        = Skin.CreateFromAlias(currentSkin);

            if (skin != null)
            {
                skin.RollbackDependencies();

                if (skin.OverridesTemplates())
                {
                    skin.RollbackTemplateFiles();
                }

                //else
                //    skin.RollbackDependencies();
            }

            RemoveSkin(template);
            Save();
        }