PolicyStatement.FromXml Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
- Source:
- PolicyStatement.cs
- Source:
- PolicyStatement.cs
- Source:
- PolicyStatement.cs
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
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)
Applies to
FromXml(SecurityElement, PolicyLevel)
- Source:
- PolicyStatement.cs
- Source:
- PolicyStatement.cs
- Source:
- PolicyStatement.cs
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
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.