<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.1.20120.5" />

FileDialogPermissionAttribute

Allows security actions for FileDialogPermission to be applied to code using declarative security. This class cannot be inherited.
public bool Open { get; set; }

Gets or sets a value indicating whether permission to open files through the file dialog is declared.

public bool Save { get; set; }

Gets or sets a value indicating whether permission to save files through the file dialog is declared.

Initializes a new instance of the FileDialogPermissionAttribute class with the specified SecurityAction.