다음을 통해 공유


SimpleDelegatedModuleProvider.GetSupportedChildDelegationStates 메서드

정의

지원되는 자식 위임 상태의 배열을 검색합니다.

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()

매개 변수

path
String

호출 호스트의 경로입니다.

반환

지원되는 상태를 포함하는 형식 DelegationState 의 배열입니다.

예외

pathnull이거나 비어 있는 경우

path 에는 "/" 문자가 포함됩니다.

예제

다음 예제에서는 이 메서드를 재정의하고 기본 클래스 코드를 복제합니다.

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};
}

적용 대상