Skip to main content

FileSystemItem Class

The file system item.

Namespace: DevExtreme.AspNet.Mvc.FileManagement

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public class FileSystemItem

Remarks

The FileSystemItem class provides information about a file system item (file or folder) in the FileManager.

The following example illustrates how to use the FileSystemItem objects when you implement the GetItems(FileSystemLoadItemOptions) method for a custom file system provider. Refer to the FileManager - Binding to Entity Framework ORM online demo to see the whole code.

File system provider:

public IEnumerable<FileSystemItem> GetItems(FileSystemLoadItemOptions options) {
    int parentId = ParseKey(options.Directory.Key);
    var fileItems = GetDirectoryContents(parentId);

    var clientItemList = new List<FileSystemItem>();
    foreach(var item in fileItems) {
        var clientItem = new FileSystemItem {
            Key = item.Id.ToString(),
            Name = item.Name,
            IsDirectory = item.IsDirectory,
            DateModified = item.Modified
        };

        clientItem.CustomFields["modifiedBy"] = item.ModifiedBy.FullName;
        clientItem.CustomFields["created"] = item.Created;
        clientItemList.Add(clientItem);
    }
    return clientItemList;
}

Concepts

Online Demos

Inheritance

Object
FileSystemItem
See Also