|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DesktopBrowser.Server;
namespace DesktopBrowser.Templates
{
public partial class FilesImageList : System.Web.UI.UserControl
{
public FilesImageList()
{
Columns = 3;
}
public IEnumerable<File> Files { get; set; }
public int Columns { get; set; }
public File GetFirstImage(File folder)
{
var service = new SiteService();
var innerFiles = service.GetFiles(new SiteRequest { Path = folder.Path });
var image = innerFiles.Where(t => t.IsImage()).FirstOrDefault();
if (image == null)
{
foreach (var folder2 in innerFiles.Where(t => t.IsFolder))
{
image = GetFirstImage(folder2);
if (image != null)
break;
}
}
return image;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.