SimpleDelegatedModuleProvider.ReadOnlyDelegationState Field
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.
Specifies a read-only delegation state.
public: static initonly Microsoft::Web::Management::Server::DelegationState ^ ReadOnlyDelegationState;
public static readonly Microsoft.Web.Management.Server.DelegationState ReadOnlyDelegationState;
staticval mutable ReadOnlyDelegationState : Microsoft.Web.Management.Server.DelegationState
Public Shared ReadOnly ReadOnlyDelegationState As DelegationState
Field Value
Examples
The following example returns an array of supported child delegation states.
public static new readonly DelegationState ReadOnlyDelegationState =
new DelegationState(ReadOnlyDelegationMode,
"Read Only", "Lock feature configuration");
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);
}
}
}
Remarks
The value of this field is a DelegationState with a mode of "ReadOnly", localized text of "ReadOnlyDelegationStateText", and a localized description of "ReadOnlyDelegationStateToolTip".