ModuleProvider.GetChildDelegationState Method (String)

IIS 7.0
 

When overridden in a derived class, returns the child delegation state.

Namespace:   Microsoft.Web.Management.Server
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

public virtual DelegationState GetChildDelegationState(
	string path
)

Parameters

path
Type: System.String

The path of the calling host.

Return Value

Type: Microsoft.Web.Management.Server.DelegationState

The current child DelegationState object.

You can use the ManagementUnit property to determine the child delegation state.

The following example checks the value of the ManagementUnit property but does not use the information. The example returns a user-defined DelegationState object based on the value of the ManagementAdministrationConfiguration.Modules property.

public override DelegationState GetChildDelegationState(string path) {

    if (String.IsNullOrEmpty(path)) {
        throw new ArgumentNullException("path");
    }
    if (path.IndexOf('/') != -1) {
        throw new InvalidOperationException("Delegation Only For ImmediateChildren");
    }

    if (ManagementUnit.Scope == ManagementScope.Server) {
        Trace.WriteLine("GetChildDelegationState at Server");
    } else if (ManagementUnit.Scope == ManagementScope.Site) {
        Trace.WriteLine("Site level GetChildDelegationState");
    }

    ManagementAdministrationConfiguration administration =
        ManagementUnit.Administration.GetDelegatedScope(path);

    if (administration.Modules[Name] == null) {
        return MyDelegatedModProviderHlpr.NoneDelegationState;
    }

    return MyDelegatedModProviderHlpr.ReadWriteDelegationState;
}
internal static class MyDelegatedModProviderHlpr {

    private const string ReadOnlyDelegationMode = "ReadOnly";
    private const string ReadWriteDelegationMode = "ReadWrite";
    private const string NoneDelegationMode = "None";
    private const string ParentDelegationMode = "Parent";

    public static readonly DelegationState ReadOnlyDelegationState =
        new DelegationState(ReadOnlyDelegationMode,
        ReadOnlyDelegationMode, "Lock feature config");
    public static readonly DelegationState ReadWriteDelegationState =
        new DelegationState(ReadWriteDelegationMode,
        ReadWriteDelegationMode, "Unlock feature config");
    public static readonly DelegationState NoneDelegationState =
        new DelegationState(NoneDelegationMode,
        NoneDelegationMode, "Lock feature configuration and make the feature invisible");
    public static readonly DelegationState ParentDelegationState =
        new DelegationState(ParentDelegationMode,
        ParentDelegationMode, "Set lock state to inherited");

}
Return to top
Show: