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
public abstract void FromXml(
 SecurityElement elem
public: virtual void FromXml(
 SecurityElement* elem
) = 0;
public abstract function FromXml(
   elem : SecurityElement


The XML encoding to use to reconstruct the security object.




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.


The version number of the elem parameter is not supported.


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.


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