Exemple #1
0
        protected System.Collections.Generic.IList <ManageThemeInfo> LoadThemes(string currentThemeName)
        {
            System.Web.HttpContext context     = HiContext.Current.Context;
            System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
            System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>();
            string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + "\\Templates\\master";

            string[] array  = System.IO.Directory.Exists(path) ? System.IO.Directory.GetDirectories(path) : null;
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string path2 = array2[i];
                System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(path2);
                string text = directoryInfo.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture);
                if (text.Length > 0 && !text.StartsWith("_"))
                {
                    System.IO.FileInfo[] files  = directoryInfo.GetFiles(text + ".xml");
                    System.IO.FileInfo[] array3 = files;
                    for (int j = 0; j < array3.Length; j++)
                    {
                        System.IO.FileInfo   fileInfo        = array3[j];
                        ManageThemeInfo      manageThemeInfo = new ManageThemeInfo();
                        System.IO.FileStream fileStream      = fileInfo.OpenRead();
                        xmlDocument.Load(fileStream);
                        fileStream.Close();
                        manageThemeInfo.Name        = xmlDocument.SelectSingleNode("ManageTheme/Name").InnerText;
                        manageThemeInfo.ThemeImgUrl = xmlDocument.SelectSingleNode("ManageTheme/ImageUrl").InnerText;
                        manageThemeInfo.ThemeName   = text;
                        if (string.Compare(manageThemeInfo.ThemeName, currentThemeName) == 0)
                        {
                            this.litThemeName.Text       = manageThemeInfo.ThemeName;
                            this.imgThemeImgUrl.ImageUrl = string.Concat(new string[]
                            {
                                Globals.ApplicationPath,
                                "/Templates/master/",
                                text,
                                "/",
                                xmlDocument.SelectSingleNode("ManageTheme/ImageUrl").InnerText
                            });
                            this.Image1.ImageUrl = string.Concat(new string[]
                            {
                                Globals.ApplicationPath,
                                "/Templates/master/",
                                text,
                                "/",
                                xmlDocument.SelectSingleNode("ManageTheme/BigImageUrl").InnerText
                            });
                        }
                        list.Add(manageThemeInfo);
                    }
                }
            }
            return(list);
        }
Exemple #2
0
        protected System.Collections.Generic.IList <ManageThemeInfo> GetThemes()
        {
            System.Web.HttpContext context = HiContext.Current.Context;
            System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>();
            string path = context.Request.MapPath(HiContext.Current.GetSkinPath() + "/brandcategorythemes");

            string[] array = System.IO.Directory.Exists(path) ? System.IO.Directory.GetFiles(path) : null;
            if (array != null)
            {
                string[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    string text = array2[i];
                    if (text.EndsWith(".html"))
                    {
                        ManageThemeInfo manageThemeInfo = new ManageThemeInfo();
                        manageThemeInfo.ThemeName = (manageThemeInfo.Name = System.IO.Path.GetFileName(text));
                        list.Add(manageThemeInfo);
                    }
                }
            }
            return(list);
        }