Exemplo n.º 1
0
        public static WebFolder loadFolder(EnamlData silk, string path, string name, WebFolder parent)
        {
            WebFolder folder = new WebFolder(name, parent);

            string fullpath = (path.Length > 0) ? path + "." + name + "." : "";

            List <String> pagenames = silk.getPathKeys(fullpath + "pages");

            foreach (String pagename in pagenames)
            {
                WebPage page = WebPage.loadPage(silk, fullpath + "pages", pagename, folder);
                folder.pages.Add(page);
            }

            List <String> resourcenames = silk.getPathKeys(fullpath + "resources");

            foreach (String resname in resourcenames)
            {
                WebResource resource = WebResource.loadResource(silk, fullpath + "resources", resname, folder);
                folder.resources.Add(resource);
            }

            List <String> foldernames = silk.getPathKeys(fullpath + "folders");

            foreach (String foldername in foldernames)
            {
                WebFolder subfolder = WebFolder.loadFolder(silk, fullpath + "folders", foldername, folder);
                folder.folders.Add(subfolder);
            }

            return(folder);
        }
Exemplo n.º 2
0
        public static WebResource loadResource(EnamlData silk, string path, string name, WebFolder folder)
        {
            String respath = silk.getStringValue(path + "." + name + ".path", "");
            String resname = Path.GetFileName(respath);

            respath = Path.GetDirectoryName(respath);
            WebResource resource = new WebResource(resname, respath, folder);

            return(resource);
        }