public static RapidShareFolderInfo GetRootFolderWithChilds(string response) { RapidShareFolderInfo root = new RapidShareFolderInfo("0", "root"); List <RapidShareFolderInfo> list = GetFolderInfos(response); list.Add(root); foreach (RapidShareFolderInfo folderInfo in list) { if (folderInfo.RealFolderID != "0") { foreach (RapidShareFolderInfo folderInfo2 in list) { if (folderInfo.ParentRealFolderID == folderInfo2.RealFolderID) { folderInfo2.ChildFolders.Add(folderInfo); folderInfo2.ChildFolders = folderInfo2.ChildFolders.OrderBy(x => x.FolderName).ToList(); } } } } root.ChildFolders = root.ChildFolders.OrderBy(x => x.FolderName).ToList(); return(root); }
public RapidShareFolderInfo GetRootFolderWithChilds() { Dictionary <string, string> args = new Dictionary <string, string>(); args.Add("sub", "listrealfolders"); args.Add("login", Username); args.Add("password", Password); string response = SendRequest(HttpMethod.GET, rapidshareURL, args); return(RapidShareFolderInfo.GetRootFolderWithChilds(response)); }
public static RapidShareFolderInfo GetRootFolderWithChilds(string response) { RapidShareFolderInfo root = new RapidShareFolderInfo("0", "root"); List<RapidShareFolderInfo> list = GetFolderInfos(response); list.Add(root); foreach (RapidShareFolderInfo folderInfo in list) { if (folderInfo.RealFolderID != "0") { foreach (RapidShareFolderInfo folderInfo2 in list) { if (folderInfo.ParentRealFolderID == folderInfo2.RealFolderID) { folderInfo2.ChildFolders.Add(folderInfo); folderInfo2.ChildFolders = folderInfo2.ChildFolders.OrderBy(x => x.FolderName).ToList(); } } } } root.ChildFolders = root.ChildFolders.OrderBy(x => x.FolderName).ToList(); return root; }