FileAttachmentsOptions.CustomOpenFileWithDefaultProgram Event
Occurs prior to opening an attached file via its associated program.
Namespace: DevExpress.ExpressApp.FileAttachments.Win
Assembly: DevExpress.ExpressApp.FileAttachment.Win.v24.2.dll
NuGet Package: DevExpress.ExpressApp.FileAttachment.Win
Declaration
Event Data
The CustomOpenFileWithDefaultProgram event's data class is CustomFileOperationEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
FileData | Specifies a file about to be opened via its associated program. |
Handled | Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs. |
Remarks
For more information, refer to the following Module event description: CustomOpenFileWithDefaultProgram.
The following example demonstrates how to handle this event:
File: MySolution.Win\Startup.cs.
using DevExpress.ExpressApp.ApplicationBuilder;
using DevExpress.ExpressApp.Win.ApplicationBuilder;
// ...
public class ApplicationBuilder : IDesignTimeApplicationFactory {
public static WinApplication BuildApplication(string connectionString) {
var builder = WinApplication.CreateBuilder();
builder.UseApplication<MySolutionWindowsFormsApplication>();
builder.Modules
// ...
.AddFileAttachments(options => {
options.CustomOpenFileWithDefaultProgram += (s, e) => {
// ...
};
})
// ...
}
// ...
}
See Also