Compartilhar via


ModuleProvider.GetChildDelegationState(String) Método

Definição

Quando substituído em uma classe derivada, retorna o estado de delegação filho.

public:
 virtual Microsoft::Web::Management::Server::DelegationState ^ GetChildDelegationState(System::String ^ path);
public virtual Microsoft.Web.Management.Server.DelegationState GetChildDelegationState (string path);
abstract member GetChildDelegationState : string -> Microsoft.Web.Management.Server.DelegationState
override this.GetChildDelegationState : string -> Microsoft.Web.Management.Server.DelegationState
Public Overridable Function GetChildDelegationState (path As String) As DelegationState

Parâmetros

path
String

O caminho do host de chamada.

Retornos

O objeto filho DelegationState atual.

Exemplos

O exemplo a seguir verifica o valor da ManagementUnit propriedade, mas não usa as informações. O exemplo retorna um objeto definido DelegationState pelo usuário com base no valor da Microsoft.Web.Management.Server.ManagementAdministrationConfiguration.Modules propriedade .

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");

}

Comentários

Você pode usar a ManagementUnit propriedade para determinar o estado de delegação filho.

Aplica-se a