PolicyStatement.FromXml Method

Definition

Reconstructs a security object with a given state from an XML encoding.

Overloads

FromXml(SecurityElement)

Reconstructs a security object with a given state from an XML encoding.

FromXml(SecurityElement, PolicyLevel)

Reconstructs a security object with a given state from an XML encoding.

FromXml(SecurityElement)

Reconstructs a security object with a given state from an XML encoding.

public:
 virtual void FromXml(System::Security::SecurityElement ^ et);
public void FromXml (System.Security.SecurityElement et);
abstract member FromXml : System.Security.SecurityElement -> unit
override this.FromXml : System.Security.SecurityElement -> unit
Public Sub FromXml (et As SecurityElement)

Parameters

et
SecurityElement

The XML encoding to use to reconstruct the security object.

Implements

Exceptions

The et parameter is null.

The et parameter is not a valid PolicyStatement encoding.

Examples

The following code example shows how to use the FromXml method to reconstruct a security object from an XML encoding. This code example is part of a larger example provided for the PolicyStatement class.

SecurityElement^ newElement = gcnew SecurityElement(
   L"PolicyStatement" );
newElement->AddAttribute( L"class", (
   *policyStatement)->ToString() );
newElement->AddAttribute( L"version", L"1.1" );

newElement->AddChild( gcnew SecurityElement( L"PermissionSet" ) );

( *policyStatement)->FromXml( newElement );
SecurityElement newElement = 
    new SecurityElement("PolicyStatement");
newElement.AddAttribute("class", policyStatement.ToString());
newElement.AddAttribute("version","1.1");

newElement.AddChild(new SecurityElement("PermissionSet"));

policyStatement.FromXml(newElement);
Dim newElement As New SecurityElement("PolicyStatement")
newElement.AddAttribute("class", policyStatement.ToString())
newElement.AddAttribute("version", "1.1")

newElement.AddChild(New SecurityElement("PermissionSet"))

policyStatement.FromXml(newElement)

FromXml(SecurityElement, PolicyLevel)

Reconstructs a security object with a given state from an XML encoding.

public:
 virtual void FromXml(System::Security::SecurityElement ^ et, System::Security::Policy::PolicyLevel ^ level);
public void FromXml (System.Security.SecurityElement et, System.Security.Policy.PolicyLevel level);
abstract member FromXml : System.Security.SecurityElement * System.Security.Policy.PolicyLevel -> unit
override this.FromXml : System.Security.SecurityElement * System.Security.Policy.PolicyLevel -> unit
Public Sub FromXml (et As SecurityElement, level As PolicyLevel)

Parameters

et
SecurityElement

The XML encoding to use to reconstruct the security object.

level
PolicyLevel

The PolicyLevel context for lookup of NamedPermissionSet values.

Implements

Exceptions

The et parameter is null.

The et parameter is not a valid PolicyStatement encoding.

Applies to