📄 allowpermissionvaluehelper.cs
字号:
namespace Imps.Common
{
using System;
public class AllowPermissionValueHelper
{
private static AllowPermissionValue[] _globalValues = new AllowPermissionValue[] { AllowPermissionValue.Allow, AllowPermissionValue.AllowBuddy, AllowPermissionValue.Deny };
private static AllowPermissionValue[] _personalValues = new AllowPermissionValue[] { AllowPermissionValue.Allow, AllowPermissionValue.Deny };
public static string AllowPermissionValue2Str(PermissionRange permissionRange, AllowPermissionValue allowPermission)
{
switch (permissionRange)
{
case PermissionRange.Global:
switch (allowPermission)
{
case AllowPermissionValue.Deny:
return "拒绝所有人";
case AllowPermissionValue.Allow:
return "允许所有人";
case AllowPermissionValue.AllowBuddy:
return "只允许好友和手机好友";
}
return string.Empty;
case PermissionRange.Personal:
case PermissionRange.FinalValue:
switch (allowPermission)
{
case AllowPermissionValue.Deny:
return "拒绝";
case AllowPermissionValue.Allow:
return "允许";
}
return string.Empty;
}
return string.Empty;
}
public static AllowPermissionValue[] EnumPermissionValues(PermissionRange permissionRange)
{
switch (permissionRange)
{
case PermissionRange.Global:
return _globalValues;
case PermissionRange.Personal:
case PermissionRange.FinalValue:
return _personalValues;
}
return new AllowPermissionValue[0];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -