示例#1
0
        public static List <DisplayPage> Load(string virtualPath)
        {
            List <DisplayPage> displayPages = new List <DisplayPage>();

            if (HttpContext.Current != null)
            {
                HttpServerUtility server     = HttpContext.Current.Server;
                string            mappedPath = server.MapPath(virtualPath);
                if (Directory.Exists(mappedPath))
                {
                    string   joinPath  = string.Empty;
                    string[] aspxFiles = Directory.GetFiles(mappedPath, "*.aspx", SearchOption.TopDirectoryOnly);
                    if (aspxFiles != null)
                    {
                        for (int i = 0; i < aspxFiles.Length; i++)
                        {
                            string      virtualFilePath = Path.GetFileName(aspxFiles[i]);
                            DisplayPage dp = DisplayPageDataSource.ParseFromFile(aspxFiles[i], virtualFilePath);
                            if (dp != null)
                            {
                                displayPages.Add(dp);
                            }
                        }
                    }
                }
            }
            return(displayPages);
        }
示例#2
0
 public static List <DisplayPage> Load()
 {
     return(DisplayPageDataSource.Load("~/"));
 }