Exemplo n.º 1
0
        protected IList <ManageThemeInfo> GetThemes()
        {
            HttpContext context = HiContext.Current.Context;

            IList <ManageThemeInfo> list = new List <ManageThemeInfo>();

            string path = context.Request.MapPath(HiContext.Current.GetSkinPath() + "/categorythemes");

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            string[] strArray = Directory.Exists(path) ? Directory.GetFiles(path) : null;

            if (strArray != null && strArray.Length != 0)
            {
                ManageThemeInfo item = null;

                foreach (string str2 in strArray)
                {
                    if (str2.EndsWith(".html"))
                    {
                        ManageThemeInfo info2 = new ManageThemeInfo();
                        info2.ThemeName = item.Name = Path.GetFileName(str2);
                        item            = info2;
                        list.Add(item);
                    }
                }
            }

            return(list);
        }
Exemplo n.º 2
0
 protected IList<ManageThemeInfo> LoadThemes(string currentThemeName)
 {
     XmlDocument document = new XmlDocument();
     IList<ManageThemeInfo> list = new List<ManageThemeInfo>();
     string path = HttpContext.Current.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\vshop";
     string[] strArray = Directory.Exists(path) ? Directory.GetDirectories(path) : null;
     ManageThemeInfo item = null;
     foreach (string str3 in strArray)
     {
         DirectoryInfo info2 = new DirectoryInfo(str3);
         string str2 = info2.Name.ToLower(CultureInfo.InvariantCulture);
         if ((str2.Length > 0) && !str2.StartsWith("_"))
         {
             foreach (FileInfo info3 in info2.GetFiles("template.xml"))
             {
                 item = new ManageThemeInfo();
                 FileStream inStream = info3.OpenRead();
                 document.Load(inStream);
                 inStream.Close();
                 item.Name = document.SelectSingleNode("root/Name").InnerText;
                 item.ThemeImgUrl = Globals.ApplicationPath + "/Templates/vshop/" + str2 + "/" + document.SelectSingleNode("root/ImageUrl").InnerText;
                 item.ThemeName = str2;
                 if (string.Compare(item.ThemeName, currentThemeName) == 0)
                 {
                     this.litThemeName.Text = item.ThemeName;
                 }
                 list.Add(item);
             }
         }
     }
     return list;
 }
Exemplo n.º 3
0
        protected IList <ManageThemeInfo> LoadThemes(string currentThemeName)
        {
            XmlDocument             document = new XmlDocument();
            IList <ManageThemeInfo> list     = new List <ManageThemeInfo>();
            string path = HttpContext.Current.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\vshop";

            string[]        strArray = Directory.Exists(path) ? Directory.GetDirectories(path) : null;
            ManageThemeInfo item     = null;

            foreach (string str3 in strArray)
            {
                DirectoryInfo info2 = new DirectoryInfo(str3);
                string        str2  = info2.Name.ToLower(CultureInfo.InvariantCulture);
                if ((str2.Length > 0) && !str2.StartsWith("_"))
                {
                    foreach (FileInfo info3 in info2.GetFiles("template.xml"))
                    {
                        item = new ManageThemeInfo();
                        FileStream inStream = info3.OpenRead();
                        document.Load(inStream);
                        inStream.Close();
                        item.Name        = document.SelectSingleNode("root/Name").InnerText;
                        item.ThemeImgUrl = Globals.ApplicationPath + "/Templates/vshop/" + str2 + "/" + document.SelectSingleNode("root/ImageUrl").InnerText;
                        item.ThemeName   = str2;
                        if (string.Compare(item.ThemeName, currentThemeName) == 0)
                        {
                            this.litThemeName.Text = item.ThemeName;
                        }
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 4
0
        protected IList <ManageThemeInfo> LoadThemes(string path)
        {
            HttpContext             context  = HiContext.Current.Context;
            XmlDocument             document = new XmlDocument();
            IList <ManageThemeInfo> list     = new List <ManageThemeInfo>();
            string str = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\" + path;

            string[]        strArray = Directory.Exists(str) ? Directory.GetDirectories(str) : null;
            ManageThemeInfo item     = null;

            foreach (string str3 in strArray)
            {
                DirectoryInfo info2 = new DirectoryInfo(str3);
                string        str2  = info2.Name.ToLower(CultureInfo.InvariantCulture);
                if ((str2.Length > 0) && !str2.StartsWith("_"))
                {
                    foreach (FileInfo info3 in info2.GetFiles(str2 + ".xml"))
                    {
                        item = new ManageThemeInfo();
                        FileStream inStream = info3.OpenRead();
                        document.Load(inStream);
                        inStream.Close();
                        item.Name        = document.SelectSingleNode("ManageTheme/Name").InnerText;
                        item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText;
                        item.ThemeName   = str2;
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
        protected IList <ManageThemeInfo> GetThemes()
        {
            HttpContext             context = HiContext.Current.Context;
            IList <ManageThemeInfo> list    = new List <ManageThemeInfo>();
            string path = context.Request.MapPath(HiContext.Current.GetSkinPath() + "/brandcategorythemes");

            string[]        array           = Directory.Exists(path) ? Directory.GetFiles(path) : null;
            ManageThemeInfo manageThemeInfo = null;

            if (array != null)
            {
                string[] array2 = array;
                foreach (string text in array2)
                {
                    if (text.EndsWith(".html"))
                    {
                        manageThemeInfo = new ManageThemeInfo();
                        ManageThemeInfo manageThemeInfo2 = manageThemeInfo;
                        ManageThemeInfo manageThemeInfo3 = manageThemeInfo;
                        string          text3            = manageThemeInfo2.ThemeName = (manageThemeInfo3.Name = Path.GetFileName(text));
                        list.Add(manageThemeInfo);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 6
0
        protected System.Collections.Generic.IList <ManageThemeInfo> LoadThemes()
        {
            System.Web.HttpContext context     = Hidistro.Membership.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\\library";

            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;
                        list.Add(manageThemeInfo);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 7
0
        protected IList <ManageThemeInfo> LoadThemes(string currentThemeName)
        {
            HttpContext context = HiContext.Current.Context;

            XmlDocument document = new XmlDocument();

            IList <ManageThemeInfo> themesList = new List <ManageThemeInfo>();

            string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\library";

            string[] fileList = Directory.Exists(path) ? Directory.GetDirectories(path) : null;

            ManageThemeInfo item = null;

            DirectoryInfo directoryInfo = null;

            string themeName = "";

            FileStream inStream = null;

            foreach (string file in fileList)
            {
                directoryInfo = new DirectoryInfo(file);

                themeName = directoryInfo.Name.ToLower();

                if ((themeName.Length > 0) && !themeName.StartsWith("_"))
                {
                    foreach (FileInfo info3 in directoryInfo.GetFiles(themeName + ".xml"))
                    {
                        item = new ManageThemeInfo();

                        using (inStream = info3.OpenRead())
                        {
                            document.Load(inStream);
                        }

                        item.Name = document.SelectSingleNode("ManageTheme/Name").InnerText;

                        item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText;

                        item.ThemeName = themeName;

                        if (string.Compare(item.ThemeName, currentThemeName) == 0)
                        {
                            litThemeName.Text = item.ThemeName;

                            imgThemeImgUrl.ImageUrl = Globals.ApplicationPath + "/Templates/library/" + themeName + "/" + document.SelectSingleNode("ManageTheme/ImageUrl").InnerText;

                            Image1.ImageUrl = Globals.ApplicationPath + "/Templates/library/" + themeName + "/" + document.SelectSingleNode("ManageTheme/BigImageUrl").InnerText;
                        }

                        themesList.Add(item);
                    }
                }
            }
            return(themesList);
        }
Exemplo n.º 8
0
        protected System.Collections.Generic.IList <ManageThemeInfo> LoadThemes(string currentThemeName)
        {
            XmlDocument document = new XmlDocument();

            System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>();
            string path = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + "\\Templates\\vshop";

            string[] strArray = System.IO.Directory.Exists(path) ? System.IO.Directory.GetDirectories(path) : null;
            string[] array    = strArray;
            for (int i = 0; i < array.Length; i++)
            {
                string str3 = array[i];
                System.IO.DirectoryInfo info2 = new System.IO.DirectoryInfo(str3);
                string str4 = info2.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture);
                if (str4.Length > 0 && !str4.StartsWith("_"))
                {
                    System.IO.FileInfo[] files = info2.GetFiles("template.xml");
                    for (int j = 0; j < files.Length; j++)
                    {
                        System.IO.FileInfo   info3    = files[j];
                        ManageThemeInfo      item     = new ManageThemeInfo();
                        System.IO.FileStream inStream = info3.OpenRead();
                        document.Load(inStream);
                        inStream.Close();
                        item.Name        = document.SelectSingleNode("root/Name").InnerText;
                        item.ThemeImgUrl = string.Concat(new string[]
                        {
                            Globals.ApplicationPath,
                            "/Templates/vshop/",
                            str4,
                            "/",
                            document.SelectSingleNode("root/ImageUrl").InnerText
                        });
                        item.ThemeName = str4;
                        if (string.Compare(item.ThemeName, currentThemeName) == 0)
                        {
                            this.litThemeName.Text = item.ThemeName;
                        }
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 9
0
        protected IList <ManageThemeInfo> LoadThemes()
        {
            HttpContext context = HiContext.Current.Context;

            XmlDocument document = new XmlDocument();

            IList <ManageThemeInfo> list = new List <ManageThemeInfo>();

            string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\library";

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);                         //判断路径是否存在
            }
            string[] subDirList = Directory.Exists(path) ? Directory.GetDirectories(path) : null;

            ManageThemeInfo item      = null;
            string          themeName = "";
            DirectoryInfo   dirInfo   = null;

            foreach (string subDir in subDirList)
            {
                dirInfo = new DirectoryInfo(subDir);

                themeName = dirInfo.Name.ToLower();

                if ((themeName.Length > 0) && !themeName.StartsWith("_"))
                {
                    foreach (FileInfo fileInfo in dirInfo.GetFiles(themeName + ".xml"))
                    {
                        item = new ManageThemeInfo();
                        FileStream inStream = fileInfo.OpenRead();
                        document.Load(inStream);
                        inStream.Close();
                        item.Name        = document.SelectSingleNode("ManageTheme/Name").InnerText;
                        item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText;
                        item.ThemeName   = themeName;
                        list.Add(item);
                    }
                }
            }

            return(list);
        }
Exemplo n.º 10
0
        protected IList <ManageThemeInfo> LoadThemes(string currentThemeName)
        {
            HttpContext context     = HiContext.Current.Context;
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.XmlResolver = null;
            IList <ManageThemeInfo> list = new List <ManageThemeInfo>();
            string path = context.Request.PhysicalApplicationPath + "\\Templates\\master";

            string[]        array           = Directory.Exists(path) ? Directory.GetDirectories(path) : null;
            ManageThemeInfo manageThemeInfo = null;

            string[] array2 = array;
            foreach (string path2 in array2)
            {
                DirectoryInfo directoryInfo = new DirectoryInfo(path2);
                string        text          = directoryInfo.Name.ToLower(CultureInfo.InvariantCulture);
                if (text.Length > 0 && !text.StartsWith("_"))
                {
                    FileInfo[] files  = directoryInfo.GetFiles(text + ".xml");
                    FileInfo[] array3 = files;
                    foreach (FileInfo fileInfo in array3)
                    {
                        manageThemeInfo = new ManageThemeInfo();
                        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 = "/Templates/master/" + text + "/" + xmlDocument.SelectSingleNode("ManageTheme/ImageUrl").InnerText;
                            this.Image1.ImageUrl         = "/Templates/master/" + text + "/" + xmlDocument.SelectSingleNode("ManageTheme/BigImageUrl").InnerText;
                        }
                        list.Add(manageThemeInfo);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 11
0
        protected System.Collections.Generic.IList <ManageThemeInfo> GetThemes()
        {
            System.Web.HttpContext context = Hidistro.Membership.Context.HiContext.Current.Context;
            System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>();
            string path = context.Request.MapPath(Hidistro.Membership.Context.HiContext.Current.GetSkinPath() + "/brandcategorythemes");

            string[] array  = System.IO.Directory.Exists(path) ? System.IO.Directory.GetFiles(path) : 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);
        }