SimpleDelegatedModuleProvider.GetSupportedChildDelegationStates Method

Definition

Retrieves an array of supported child delegation states.

public:
 override cli::array <Microsoft::Web::Management::Server::DelegationState ^> ^ GetSupportedChildDelegationStates(System::String ^ path);
public override Microsoft.Web.Management.Server.DelegationState[] GetSupportedChildDelegationStates (string path);
override this.GetSupportedChildDelegationStates : string -> Microsoft.Web.Management.Server.DelegationState[]
Public Overrides Function GetSupportedChildDelegationStates (path As String) As DelegationState()

Parameters

path
String

The path of the calling host.

Returns

An array of type DelegationState that contains the supported states.

Exceptions

path is null or empty.

path contains the "/" character.

Examples

The following example overrides this method and duplicates the base class code.

public class MySimpDelegateModPrvdr : SimpleDelegatedModuleProvider {

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

    public static new readonly DelegationState ReadOnlyDelegationState =
   new DelegationState(ReadOnlyDelegationMode,
   "Read Only", "Lock feature configuration"); 

    public static new readonly DelegationState ReadWriteDelegationState =
    new DelegationState(ReadWriteDelegationMode,
    "Read/Write", "Unlock feature configuration"); 

    public static new readonly DelegationState NoneDelegationState =
    new DelegationState(NoneDelegationMode,
    "Not Delegated",
    "Lock the feature configuration and hide " +
    "the feature in site and/or application connections"); 

    public static readonly DelegationState ParentDelgateState =
    new DelegationState(ParentDelegationMode,
    "Reset to Inherited",
    "Set the configuration lock state for a feature " +
    "to the inherited state");

    public override bool SupportsDelegation {
        get {
            return true;
        }
    } 
public override DelegationState[]
    GetSupportedChildDelegationStates(string path) {

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

    return new DelegationState[] { 
        NoneDelegationState, 
        ReadWriteDelegationState, 
        ParentDelgateState};
}

Applies to