.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+

FileAttachmentsWindowsFormsModule.GetFileDataManager(XafApplication) Method

Provides access to the file data manager used by the FileAttachmentsWindowsFormsModule.

Namespace: DevExpress.ExpressApp.FileAttachments.Win

Assembly: DevExpress.ExpressApp.FileAttachment.Win.v21.1.dll

Declaration

public static IFileDataManager GetFileDataManager(
    XafApplication application
)

Parameters

Name Type Description
application XafApplication

An XafApplication object that provides methods and properties to manage the current application.

Returns

Type Description
DevExpress.ExpressApp.FileAttachments.Win.IFileDataManager

An IFileDataManager object that can be used to open stored files using an associated application or to save them to a local disk.

Remarks

The following code snippet demonstrates an Action that opens all resume files. The Action is designed for List Views of the Resume business class, which is declared in the MainDemo installed in the %PUBLIC%\Documents\DevExpress Demos 21.1\Components.NET Core Desktop Libraries\eXpressApp Framework\MainDemo folder, by default.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.FileAttachments.Win;
//...
public class MyViewController : ViewController<ListView> {
    SimpleAction openSelectedDocuments;
    public MyViewController() {
        TargetObjectType = typeof(Resume);
        openSelectedDocuments = new SimpleAction(
            this, "OpenSelectedDocumentsAction", "RecordEdit", openSelectedDocuments_Execute);
        openSelectedDocuments.Caption = "Open Selected Documents";
        openSelectedDocuments.SelectionDependencyType = 
            SelectionDependencyType.RequireMultipleObjects;
    }
    void openSelectedDocuments_Execute(object sender, SimpleActionExecuteEventArgs e) {
        foreach (Resume resume in View.SelectedObjects) {
            if (resume.File != null) {
                FileAttachmentsWindowsFormsModule.GetFileDataManager(Application).Open(resume.File);
            }
        }
    }
}
See Also