using System;
using System.Runtime.InteropServices;
namespace System.Security.Permissions
{
/// Allows security actions for to be applied to code using declarative security. This class cannot be inherited.
// Token: 0x02000543 RID: 1347
[ComVisible(true)]
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
[Serializable]
public sealed class FileDialogPermissionAttribute : CodeAccessSecurityAttribute
{
/// Initializes a new instance of the class with the specified .
/// One of the values.
// Token: 0x0600313E RID: 12606 RVA: 0x000A97E0 File Offset: 0x000A79E0
public FileDialogPermissionAttribute(SecurityAction action)
: base(action)
{
}
/// Gets or sets a value indicating whether permission to open files through the file dialog is declared.
/// true if permission to open files through the file dialog is declared; otherwise, false.
// Token: 0x170009A1 RID: 2465
// (get) Token: 0x0600313F RID: 12607 RVA: 0x000A97EC File Offset: 0x000A79EC
// (set) Token: 0x06003140 RID: 12608 RVA: 0x000A97F4 File Offset: 0x000A79F4
public bool Open
{
get
{
return this.canOpen;
}
set
{
this.canOpen = value;
}
}
/// Gets or sets a value indicating whether permission to save files through the file dialog is declared.
/// true if permission to save files through the file dialog is declared; otherwise, false.
// Token: 0x170009A2 RID: 2466
// (get) Token: 0x06003141 RID: 12609 RVA: 0x000A9800 File Offset: 0x000A7A00
// (set) Token: 0x06003142 RID: 12610 RVA: 0x000A9808 File Offset: 0x000A7A08
public bool Save
{
get
{
return this.canSave;
}
set
{
this.canSave = value;
}
}
/// Creates and returns a new .
/// A that corresponds to this attribute.
// Token: 0x06003143 RID: 12611 RVA: 0x000A9814 File Offset: 0x000A7A14
public override IPermission CreatePermission()
{
FileDialogPermission fileDialogPermission;
if (base.Unrestricted)
{
fileDialogPermission = new FileDialogPermission(PermissionState.Unrestricted);
}
else
{
FileDialogPermissionAccess fileDialogPermissionAccess = FileDialogPermissionAccess.None;
if (this.canOpen)
{
fileDialogPermissionAccess |= FileDialogPermissionAccess.Open;
}
if (this.canSave)
{
fileDialogPermissionAccess |= FileDialogPermissionAccess.Save;
}
fileDialogPermission = new FileDialogPermission(fileDialogPermissionAccess);
}
return fileDialogPermission;
}
// Token: 0x0400141E RID: 5150
private bool canOpen;
// Token: 0x0400141F RID: 5151
private bool canSave;
}
}