SimpleDelegatedModuleProvider.GetChildDelegationState(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the child delegation state.
public:
override Microsoft::Web::Management::Server::DelegationState ^ GetChildDelegationState(System::String ^ path);
public override Microsoft.Web.Management.Server.DelegationState GetChildDelegationState (string path);
override this.GetChildDelegationState : string -> Microsoft.Web.Management.Server.DelegationState
Public Overrides Function GetChildDelegationState (path As String) As DelegationState
Parameters
- path
- String
The path of the calling host.
Returns
The current child DelegationState object.
Exceptions
path
is null
or empty.
path
contains the "/" character.
Examples
The following example writes the value of the GetChildDelegationState property to the trace listener.
void tstMSDP(string path) {
MySimpDelegateModPrvdr msdmp = new MySimpDelegateModPrvdr();
Trace.WriteLine("ChildDelegationState: " +
msdmp.GetChildDelegationState(path).ToString());
}
The following example overrides this method and duplicates the base class code.
public override DelegationState GetChildDelegationState(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 '/'.");
}
ManagementAdministrationConfiguration administration =
ManagementUnit.Administration.GetDelegatedScope(path);
if (administration.Modules[Name] == null) {
return NoneDelegationState;
}
return ReadWriteDelegationState;
}
Remarks
The base-class delegation state for the simple delegated module provider is either ReadWriteDelegationState or NoneDelegationState, because the module is either present or not.
This method can get delegation only for immediate child delegation states.