FileDialogPermissionAttribute Třída

Definice

Upozornění

Code Access Security is not supported or honored by the runtime.

Umožňuje použití akcí FileDialogPermission zabezpečení pro kód pomocí deklarativního zabezpečení. Tuto třídu nelze dědit.

public ref class FileDialogPermissionAttribute sealed : System::Security::Permissions::CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class FileDialogPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type FileDialogPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class FileDialogPermissionAttribute
Inherits CodeAccessSecurityAttribute
Dědičnost
Atributy

Příklady

Následující příklad kódu ukazuje, jak požadovat, aby volající kód měl FileDialogPermission. Požadavky se obvykle provádějí ve spravovaných knihovnách (DLL), které pomáhají chránit metody nebo třídy před potenciálně škodlivým kódem.

[FileDialogPermissionAttribute(SecurityAction::Demand,Unrestricted=true)]
[FileDialogPermissionAttribute(SecurityAction.Demand, Unrestricted=true)]
<FileDialogPermissionAttribute(SecurityAction.Demand, _
 Unrestricted := True)> Public Class SampleClass

Poznámky

Důležité

Částečně důvěryhodný kód se už nepodporuje. Tento atribut nemá žádný vliv na .NET Core.

Rozsah povolené deklarace závisí na SecurityAction použitém souboru.

Informace o zabezpečení deklarované atributem zabezpečení jsou uloženy v metadatech cíle atributu a jsou přístupné systémem za běhu. Atributy zabezpečení se používají pouze pro deklarativní zabezpečení. Pro imperativní zabezpečení použijte odpovídající třídu oprávnění.

Konstruktory

FileDialogPermissionAttribute(SecurityAction)

Inicializuje novou instanci FileDialogPermissionAttribute třídy se zadaným SecurityAction.

Vlastnosti

Action

Získá nebo nastaví akci zabezpečení.

(Zděděno od SecurityAttribute)
Open

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k otevření souborů prostřednictvím dialogového okna souboru.

Save

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k ukládání souborů prostřednictvím dialogového okna souboru.

TypeId

Při implementaci v odvozené třídě získá jedinečný identifikátor pro tento Attribute.

(Zděděno od Attribute)
Unrestricted

Získá nebo nastaví hodnotu určující, zda je deklarováno úplné (neomezené) oprávnění k prostředku chráněnému atributem.

(Zděděno od SecurityAttribute)

Metody

CreatePermission()

Vytvoří a vrátí novou FileDialogPermission.

Equals(Object)

Vrací hodnotu, která určuje, zda je tato instance rovna zadanému objektu.

(Zděděno od Attribute)
GetHashCode()

Vrátí hodnotu hash pro tuto instanci.

(Zděděno od Attribute)
GetType()

Type Získá aktuální instanci.

(Zděděno od Object)
IsDefaultAttribute()

Při přepsání v odvozené třídě určuje, zda hodnota této instance je výchozí hodnotou odvozené třídy.

(Zděděno od Attribute)
Match(Object)

Při přepsání v odvozené třídě vrátí hodnotu, která označuje, zda se tato instance rovná zadanému objektu.

(Zděděno od Attribute)
MemberwiseClone()

Vytvoří použádnou kopii aktuálního souboru Object.

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mapuje sadu názvů na odpovídající sadu identifikátorů pro rozesílání.

(Zděděno od Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Načte informace o typu objektu, který lze použít k získání informací o typu rozhraní.

(Zděděno od Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Získá počet rozhraní typu informací, které objekt poskytuje (0 nebo 1).

(Zděděno od Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Poskytuje přístup k vlastnostem a metodám vystaveným objektem.

(Zděděno od Attribute)

Platí pro

Viz také