Tab
A newer version of this page is available. Switch to the current version.

FileManagerDetailsViewStyles Class

Contains settings that allow the appearance of elements, used within the ASPxFileManager file list in details view, to be defined.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public class FileManagerDetailsViewStyles :
    GridViewStyles
Public Class FileManagerDetailsViewStyles
    Inherits GridViewStyles

Related API Members

The following members accept/return FileManagerDetailsViewStyles objects:

Library Related API Members
ASP.NET Controls and MVC Extensions ASPxFileManager.StylesDetailsView
FileManagerSettings.StylesDetailsView
ASP.NET Bootstrap Controls BootstrapFileManager.StylesDetailsView

Remarks

These settings can be accessed via the ASPxFileManager.StylesDetailsView property.

Examples

The following example illustrates how to specify permissions for files and folders within the ASPxFileManager.

NOTE

A complete sample project demonstrating this approach in action is available in the DevExpress Code Examples database at ASPxFileManager - How to implement a custom FileSystem provider and set required permissions to files or folders.

public override FileManagerFilePermissions GetFilePermissions(FileManagerFile file) {
    int fileId = int.Parse(file.Id);
    Permissions permissions = Data.PermissionsSet.FirstOrDefault(p => p.Item.Id == fileId);
    if(permissions == null)
        return FileManagerFilePermissions.Default;
    return GetFilePermissionsInternal(permissions);
}

public override FileManagerFolderPermissions GetFolderPermissions(FileManagerFolder folder) {
    if(string.IsNullOrEmpty(folder.RelativeName))
        return FileManagerFolderPermissions.Default;
    int folderId = int.Parse(folder.Id);
    Permissions permissions = Data.PermissionsSet.FirstOrDefault(p => p.Item.Id == folderId);
    if(permissions == null)
        return FileManagerFolderPermissions.Default;
    return GetFolderPermissionsInternal(permissions);
}

FileManagerFilePermissions GetFilePermissionsInternal(Permissions permissions) {
    return (permissions.Delete ? FileManagerFilePermissions.Delete : FileManagerFilePermissions.Default)
        | (permissions.Move ? FileManagerFilePermissions.Move : FileManagerFilePermissions.Default)
        | (permissions.Copy ? FileManagerFilePermissions.Copy : FileManagerFilePermissions.Default)
        | (permissions.Rename ? FileManagerFilePermissions.Rename : FileManagerFilePermissions.Default)
        | (permissions.Download ? FileManagerFilePermissions.Download : FileManagerFilePermissions.Default);
}

FileManagerFolderPermissions GetFolderPermissionsInternal(Permissions permissions) {
    return (permissions.Delete ? FileManagerFolderPermissions.Delete : FileManagerFolderPermissions.Default)
        | (permissions.Move ? FileManagerFolderPermissions.Move : FileManagerFolderPermissions.Default)
        | (permissions.Copy ? FileManagerFolderPermissions.Copy : FileManagerFolderPermissions.Default)
        | (permissions.Rename ? FileManagerFolderPermissions.Rename : FileManagerFolderPermissions.Default)
        | (permissions.Create ? FileManagerFolderPermissions.Create : FileManagerFolderPermissions.Default)
        | (permissions.Upload ? FileManagerFolderPermissions.Upload : FileManagerFolderPermissions.Default)
        | (permissions.MoveOrCopyInto ? FileManagerFolderPermissions.MoveOrCopyInto : FileManagerFolderPermissions.Default);
}

Implements

Inheritance

Object
StateManager
PropertiesBase
StylesBase
DevExpress.Web.GridStyles
GridViewStyles
FileManagerDetailsViewStyles
See Also