Beispiel #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();
            }
        }