Compartir a través de


SimpleDelegatedModuleProvider.SetChildDelegationState Método

Definición

Establece el estado de delegación especificado para todas las configuraciones secundarias de la ruta de acceso especificada.

public:
 override void SetChildDelegationState(System::String ^ path, Microsoft::Web::Management::Server::DelegationState ^ state);
public override void SetChildDelegationState (string path, Microsoft.Web.Management.Server.DelegationState state);
override this.SetChildDelegationState : string * Microsoft.Web.Management.Server.DelegationState -> unit
Public Overrides Sub SetChildDelegationState (path As String, state As DelegationState)

Parámetros

path
String

Ruta de acceso del host que llama.

state
DelegationState

Objeto DelegationState que se va a establecer.

Excepciones

El valor de path es null o está vacío.

path contiene el carácter "/".

Ejemplos

En el ejemplo siguiente se invalida este método y se duplica el código de clase base.

public override void SetChildDelegationState(string path,
    DelegationState state) {

    if (String.IsNullOrEmpty(path)) {
        throw new ArgumentNullException("path");
    }
    if (path.IndexOf('/') != -1) {
        throw new InvalidOperationException(
            "Cannot retrieve the delegation state " +
             "for paths that contain '/'.");
    }

    AdministrationModule currentModule =
        ManagementUnit.Administration.Modules[Name];

    // Get the management administration configuration 
    // for the delegated path.
    ManagementAdministrationConfiguration
        delegatedAdministration =
        ManagementUnit.Administration.GetDelegatedScope(path);
    AdministrationModuleCollection delegatedModules
        = delegatedAdministration.Modules;

    if ((state == ParentDelgateState) ||
        (state == ReadWriteDelegationState) ||
        (state == ReadOnlyDelegationState)) {

        delegatedModules.Add(currentModule.Name);
    } else if (state == NoneDelegationState) {
        if (currentModule != null) {
            delegatedModules.Remove(currentModule.Name);
        }
    }
} 

Se aplica a