Files
Dec2017-Script-Dump/mscorlib/System/Security/Permissions/RegistryPermissionAttribute.cs
T
2026-06-04 11:42:34 +02:00

193 lines
6.5 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace System.Security.Permissions
{
/// <summary>Allows security actions for <see cref="T:System.Security.Permissions.RegistryPermission" /> to be applied to code using declarative security. This class cannot be inherited.</summary>
// Token: 0x02000566 RID: 1382
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
[ComVisible(true)]
[Serializable]
public sealed class RegistryPermissionAttribute : CodeAccessSecurityAttribute
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.RegistryPermissionAttribute" /> class with the specified <see cref="T:System.Security.Permissions.SecurityAction" />.</summary>
/// <param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="action" /> parameter is not a valid <see cref="T:System.Security.Permissions.SecurityAction" />. </exception>
// Token: 0x0600327A RID: 12922 RVA: 0x000ADC5C File Offset: 0x000ABE5C
public RegistryPermissionAttribute(SecurityAction action)
: base(action)
{
}
/// <summary>Gets or sets full access for the specified registry keys.</summary>
/// <returns>A semicolon-separated list of registry key paths, for full access. </returns>
/// <exception cref="T:System.NotSupportedException">The get accessor is called; it is only provided for C# compiler compatibility.</exception>
// Token: 0x170009E7 RID: 2535
// (get) Token: 0x0600327B RID: 12923 RVA: 0x000ADC68 File Offset: 0x000ABE68
// (set) Token: 0x0600327C RID: 12924 RVA: 0x000ADC74 File Offset: 0x000ABE74
[Obsolete("use newer properties")]
public string All
{
get
{
throw new NotSupportedException("All");
}
set
{
this.create = value;
this.read = value;
this.write = value;
}
}
/// <summary>Gets or sets create-level access for the specified registry keys. </summary>
/// <returns>A semicolon-separated list of registry key paths, for create-level access. </returns>
// Token: 0x170009E8 RID: 2536
// (get) Token: 0x0600327D RID: 12925 RVA: 0x000ADC8C File Offset: 0x000ABE8C
// (set) Token: 0x0600327E RID: 12926 RVA: 0x000ADC94 File Offset: 0x000ABE94
public string Create
{
get
{
return this.create;
}
set
{
this.create = value;
}
}
/// <summary>Gets or sets read access for the specified registry keys.</summary>
/// <returns>A semicolon-separated list of registry key paths, for read access. </returns>
// Token: 0x170009E9 RID: 2537
// (get) Token: 0x0600327F RID: 12927 RVA: 0x000ADCA0 File Offset: 0x000ABEA0
// (set) Token: 0x06003280 RID: 12928 RVA: 0x000ADCA8 File Offset: 0x000ABEA8
public string Read
{
get
{
return this.read;
}
set
{
this.read = value;
}
}
/// <summary>Gets or sets write access for the specified registry keys.</summary>
/// <returns>A semicolon-separated list of registry key paths, for write access. </returns>
// Token: 0x170009EA RID: 2538
// (get) Token: 0x06003281 RID: 12929 RVA: 0x000ADCB4 File Offset: 0x000ABEB4
// (set) Token: 0x06003282 RID: 12930 RVA: 0x000ADCBC File Offset: 0x000ABEBC
public string Write
{
get
{
return this.write;
}
set
{
this.write = value;
}
}
/// <summary>Gets or sets change access control for the specified registry keys.</summary>
/// <returns>A semicolon-separated list of registry key paths, for change access control. .</returns>
// Token: 0x170009EB RID: 2539
// (get) Token: 0x06003283 RID: 12931 RVA: 0x000ADCC8 File Offset: 0x000ABEC8
// (set) Token: 0x06003284 RID: 12932 RVA: 0x000ADCD0 File Offset: 0x000ABED0
public string ChangeAccessControl
{
get
{
return this.changeAccessControl;
}
set
{
this.changeAccessControl = value;
}
}
/// <summary>Gets or sets view access control for the specified registry keys.</summary>
/// <returns>A semicolon-separated list of registry key paths, for view access control.</returns>
// Token: 0x170009EC RID: 2540
// (get) Token: 0x06003285 RID: 12933 RVA: 0x000ADCDC File Offset: 0x000ABEDC
// (set) Token: 0x06003286 RID: 12934 RVA: 0x000ADCE4 File Offset: 0x000ABEE4
public string ViewAccessControl
{
get
{
return this.viewAccessControl;
}
set
{
this.viewAccessControl = value;
}
}
/// <summary>Gets or sets a specified set of registry keys that can be viewed and modified.</summary>
/// <returns>A semicolon-separated list of registry key paths, for create, read, and write access. </returns>
/// <exception cref="T:System.NotSupportedException">The get accessor is called; it is only provided for C# compiler compatibility. </exception>
// Token: 0x170009ED RID: 2541
// (get) Token: 0x06003287 RID: 12935 RVA: 0x000ADCF0 File Offset: 0x000ABEF0
// (set) Token: 0x06003288 RID: 12936 RVA: 0x000ADCF8 File Offset: 0x000ABEF8
public string ViewAndModify
{
get
{
throw new NotSupportedException();
}
set
{
this.create = value;
this.read = value;
this.write = value;
}
}
/// <summary>Creates and returns a new <see cref="T:System.Security.Permissions.RegistryPermission" />.</summary>
/// <returns>A <see cref="T:System.Security.Permissions.RegistryPermission" /> that corresponds to this attribute.</returns>
// Token: 0x06003289 RID: 12937 RVA: 0x000ADD10 File Offset: 0x000ABF10
public override IPermission CreatePermission()
{
RegistryPermission registryPermission;
if (base.Unrestricted)
{
registryPermission = new RegistryPermission(PermissionState.Unrestricted);
}
else
{
registryPermission = new RegistryPermission(PermissionState.None);
if (this.create != null)
{
registryPermission.AddPathList(RegistryPermissionAccess.Create, this.create);
}
if (this.read != null)
{
registryPermission.AddPathList(RegistryPermissionAccess.Read, this.read);
}
if (this.write != null)
{
registryPermission.AddPathList(RegistryPermissionAccess.Write, this.write);
}
}
return registryPermission;
}
// Token: 0x040014BB RID: 5307
private string create;
// Token: 0x040014BC RID: 5308
private string read;
// Token: 0x040014BD RID: 5309
private string write;
// Token: 0x040014BE RID: 5310
private string changeAccessControl;
// Token: 0x040014BF RID: 5311
private string viewAccessControl;
}
}