本文整理汇总了C#中PermissionState类的典型用法代码示例。如果您正苦于以下问题:C# PermissionState类的具体用法?C# PermissionState怎么用?C# PermissionState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermissionState类属于命名空间,在下文中一共展示了PermissionState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
internal IsolatedStoragePermission
(IsolatedStoragePermissionAttribute copyFrom)
{
this.state = PermissionState.None;
this.userQuota = copyFrom.userQuota;
this.usageAllowed = copyFrom.usageAllowed;
}
示例2: RegistryPermission
public RegistryPermission(RegistryPermissionAccess flag, String pathList)
{
if(pathList == null)
{
throw new ArgumentNullException("pathList");
}
if((flag & ~(RegistryPermissionAccess.AllAccess)) != 0)
{
throw new ArgumentException(_("Arg_RegistryAccess"));
}
this.state = PermissionState.None;
String[] split = EnvironmentPermission.SplitPath(pathList);
if((flag & RegistryPermissionAccess.Read) != 0)
{
readList = split;
}
if((flag & RegistryPermissionAccess.Write) != 0)
{
writeList = split;
}
if((flag & RegistryPermissionAccess.Create) != 0)
{
createList = split;
}
}
示例3: PerformanceCounterPermission
public PerformanceCounterPermission(PermissionState state)
: base(state)
{
PermissionAccessType =
typeof(PerformanceCounterPermissionAccess);
TagNames = new String [] {"Machine", "Category"};
}
示例4: UIPermission
// Constructors
public UIPermission (PermissionState state)
{
if (CheckPermissionState (state, true) == PermissionState.Unrestricted) {
_clipboard = UIPermissionClipboard.AllClipboard;
_window = UIPermissionWindow.AllWindows;
}
}
示例5: IsolatedStoragePermission
public IsolatedStoragePermission (PermissionState state)
#endif
{
if (CheckPermissionState (state, true) == PermissionState.Unrestricted) {
UsageAllowed = IsolatedStorageContainment.UnrestrictedIsolatedStorage;
}
}
示例6: ZoneIdentityPermission
public ZoneIdentityPermission (PermissionState state)
{
// false == do not allow Unrestricted for Identity Permissions
CheckPermissionState (state, false);
// default values
zone = SecurityZone.NoZone;
}
示例7: FromXml
// Convert an XML value into a permissions value.
public override void FromXml(SecurityElement esd)
{
String value;
if(esd == null)
{
throw new ArgumentNullException("esd");
}
if(esd.Attribute("version") != "1")
{
throw new ArgumentException(S._("Arg_PermissionVersion"));
}
value = esd.Attribute("Unrestricted");
if(value != null && Boolean.Parse(value))
{
state = PermissionState.Unrestricted;
}
else
{
state = PermissionState.None;
}
value = esd.Attribute("Level");
if(value != null)
{
level = (PrintingPermissionLevel)
Enum.Parse(typeof(PrintingPermissionLevel), value);
}
else
{
level = PrintingPermissionLevel.NoPrinting;
}
}
示例8: FileIOPermission
public FileIOPermission(FileIOPermissionAccess flag, String pathList)
{
if(pathList == null)
{
throw new ArgumentNullException("pathList");
}
if((flag & ~(FileIOPermissionAccess.AllAccess)) != 0)
{
throw new ArgumentException(_("Arg_FileIOAccess"));
}
this.state = PermissionState.None;
String[] split = EnvironmentPermission.SplitPath(pathList);
if((flag & FileIOPermissionAccess.Read) != 0)
{
readList = split;
}
if((flag & FileIOPermissionAccess.Write) != 0)
{
writeList = split;
}
if((flag & FileIOPermissionAccess.Append) != 0)
{
appendList = split;
}
if((flag & FileIOPermissionAccess.PathDiscovery) != 0)
{
discoveryList = split;
}
allLocalFiles = FileIOPermissionAccess.NoAccess;
allFiles = FileIOPermissionAccess.NoAccess;
}
示例9: EnvironmentPermission
internal EnvironmentPermission(PermissionState state, String[] readList,
String[] writeList)
{
this.state = state;
this.readList = readList;
this.writeList = writeList;
}
示例10: IngresPermission
/// <summary>
/// Creates a new instance of IngresPermission.
/// </summary>
/// <param name="state">
/// PermissionState for access to all or no resources.</param>
/// <param name="allowBlankPassword"></param>
public IngresPermission(
PermissionState state,
bool allowBlankPassword)
: base(state)
{
this.AllowBlankPassword = allowBlankPassword;
}
示例11: StorePermission
public StorePermission (PermissionState state)
{
if (PermissionHelper.CheckPermissionState (state, true) == PermissionState.Unrestricted)
_flags = StorePermissionFlags.AllFlags;
else
_flags = StorePermissionFlags.NoFlags;
}
示例12: SecurityPermission
// constructors
public SecurityPermission (PermissionState state)
{
if (CheckPermissionState (state, true) == PermissionState.Unrestricted)
flags = SecurityPermissionFlag.AllFlags;
else
flags = SecurityPermissionFlag.NoFlags;
}
示例13: FromXml
// Convert an XML value into a permissions value.
public override void FromXml(SecurityElement esd)
{
String value;
if(esd == null)
{
throw new ArgumentNullException("esd");
}
if(esd.Attribute("version") != "1")
{
throw new ArgumentException(_("Arg_PermissionVersion"));
}
value = esd.Attribute("Unrestricted");
if(value != null && Boolean.Parse(value))
{
state = PermissionState.Unrestricted;
}
else
{
state = PermissionState.None;
}
value = esd.Attribute("Access");
if(value != null)
{
flags = (FileDialogPermissionAccess)
Enum.Parse(typeof(FileDialogPermissionAccess), value);
}
else
{
flags = FileDialogPermissionAccess.None;
}
}
示例14: ReflectionPermission
public ReflectionPermission (PermissionState state)
{
if (CheckPermissionState (state, true) == PermissionState.Unrestricted)
flags = ReflectionPermissionFlag.AllFlags;
else
flags = ReflectionPermissionFlag.NoFlags;
}
示例15: RegistryPermission
// private AccessControlActions _control;
#endif
// Constructors
public RegistryPermission (PermissionState state)
{
_state = CheckPermissionState (state, true);
createList = new ArrayList ();
readList = new ArrayList ();
writeList = new ArrayList ();
}