Constable Authorization Engine 2.0 BETA

AuthorizationPolicyLoader.LoadFromXmlResource Method (String)

[This is preliminary documentation and subject to change.]

Loads an instance of the AuthorizationPolicy class populated from an authorization policy stored as a XML resource in the calling assembly's manifest.

[Visual Basic]
Overloads Public Shared Function LoadFromXmlResource( _
   ByVal resourceName As String _
) As AuthorizationPolicy
[C#]
public static AuthorizationPolicy LoadFromXmlResource(
   string resourceName
);

Parameters

resourceName
The name of the resource embedded in the calling assembly's manifest.

Return Value

An instance of the AuthorizationPolicy class populated from the given resource.

Example

The following example loads an authorization policy embedded as a resource named "LaMarvin.Constable.Test._doc.xml":

[Visual Basic]
Dim resourceName As String = "LaMarvin.Constable.Test._doc.xml"
Dim policy As AuthorizationPolicy = AuthorizationPolicyLoader.LoadFromXmlResource(resourceName)

[C#]
string resourceName = "LaMarvin.Constable.Test._doc.xml";
AuthorizationPolicy policy = AuthorizationPolicyLoader.LoadFromXmlResource(resourceName);
CAUTION Please note that we've qualified the name of the embedded XML file ("_doc.xml") with the default namespace that is defined for the particular assembly's project. If you're not sure what is the fully qualified name of your embedded resource, just compile the assembly and examine it with the ILDasm tool that comes with .NET Framework installation.

See Also

AuthorizationPolicyLoader Class | LaMarvin.Constable Namespace | AuthorizationPolicyLoader.LoadFromXmlResource Overload List