Share via


DataProtectionPermission.FromXml(SecurityElement) メソッド

定義

XML エンコードからの特定の状態で、アクセス許可を再構築します。

public:
 override void FromXml(System::Security::SecurityElement ^ securityElement);
public override void FromXml (System.Security.SecurityElement securityElement);
override this.FromXml : System.Security.SecurityElement -> unit
Public Overrides Sub FromXml (securityElement As SecurityElement)

パラメーター

securityElement
SecurityElement

アクセス許可の再構築に使用する XML エンコードを含む SecurityElement

例外

securityElementnullです。

securityElement が正しいアクセス許可要素ではありません。

- または -

securityElement のバージョン番号はサポートされていません。

次のコード例は、 メソッドの使用方法を FromXml 示しています。 このコード例は、DataProtectionPermission クラスのために提供されている大規模な例の一部です。

注意

このコード例は、 メソッドの動作を示すことを目的としたもので、その使用方法を示すものではありません。 一般に、アクセス許可クラスのメソッドはセキュリティ インフラストラクチャによって使用されます。通常、アプリケーションでは使用されません。

Console::WriteLine( "Using an XML round trip to reset the fourth "
"permission." );
sp4->FromXml( sp2->ToXml() );
rc = sp4->Equals( sp2 );
Console::WriteLine( "Does the XML round trip result equal the "
"original permission? {0}", (rc ? (String^)"Yes" : "No") );
Console.WriteLine("Using an XML round trip to reset the fourth " +
    "permission.");
sp4.FromXml(sp2.ToXml());
rc = sp4.Equals(sp2);
Console.WriteLine("Does the XML round trip result equal the " +
    "original permission? " + (rc ? "Yes" : "No"));
    Console.WriteLine("Using an XML round trip to reset the fourth " + "permission.")
    sp4.FromXml(sp2.ToXml())
    rc = sp4.Equals(sp2)
    Console.WriteLine("Does the XML round trip result equal the " + "original permission? " + IIf(rc, "Yes", "No")) 'TODO: For performance reasons this should be changed to nested IF statements

End Sub

注釈

メソッドはFromXml、 クラスによって定義された XML エンコードからオブジェクトをSecurityElement再構築DataProtectionPermissionします。 メソッドを ToXml 使用して、状態情報を含む を DataProtectionPermissionXML エンコードします。

適用対象