SimpleDelegatedModuleProvider.ReadOnlyDelegationState 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定只读委派状态。
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
字段值
示例
以下示例返回支持的子委派状态的数组。
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);
}
}
}
注解
此字段的值是一个 DelegationState ,其模式为“ReadOnly”,本地化文本为“ReadOnlyDelegationStateText”,本地化说明为“ReadOnlyDelegationStateToolTip”。