Skip to main content
All docs
V24.2
.NET 8.0+
  • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

public event EventHandler<CustomFileOperationEventArgs> CustomOpenFileWithDefaultProgram

#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