This documentation is archived and is not being maintained.

CodeAccessPermission.FromXml Method

When overridden in a derived class, reconstructs a security object with a specified state from an XML encoding.

[Visual Basic]
Public MustOverride Sub FromXml( _
   ByVal elem As SecurityElement _
) Implements ISecurityEncodable.FromXml
[C#]
public abstract void FromXml(
 SecurityElement elem
);
[C++]
public: virtual void FromXml(
 SecurityElement* elem
) = 0;
[JScript]
public abstract function FromXml(
   elem : SecurityElement
);

Parameters

elem
The XML encoding to use to reconstruct the security object.

Implements

ISecurityEncodable.FromXml

Exceptions

Exception Type Condition
ArgumentNullException The elem parameter is a null reference (Nothing in Visual Basic).
ArgumentException The elem parameter does not contain the XML encoding for an instance of the same type as the current instance.

-or-

The version number of the elem parameter is not supported.

Remarks

Custom code that extends security objects needs to implement the ToXml and FromXml methods to make the objects security-encodable.

Notes to Inheritors:  You must implement this method in a derived class.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

CodeAccessPermission Class | CodeAccessPermission Members | System.Security Namespace

Show: