本文整理汇总了C#中AccessLevel类的典型用法代码示例。如果您正苦于以下问题:C# AccessLevel类的具体用法?C# AccessLevel怎么用?C# AccessLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccessLevel类属于命名空间,在下文中一共展示了AccessLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApiAttribute
/// <summary>
/// Constructor
/// </summary>
/// <param name="route"></param>
/// <param name="method"></param>
/// <param name="isSecure"></param>
/// <param name="roleLevel"></param>
public ApiAttribute(string route, ApiMethod method, bool isSecure, AccessLevel roleLevel)
{
this._route = route;
this._method = method;
this._isSecure = isSecure;
this._roleLevel = (int)roleLevel;
}
示例2: ClearanceException
public ClearanceException(Property property, AccessLevel playerAccess, AccessLevel neededAccess, string accessType)
: base(property, string.Format(
"You must be at least {0} to {1} this property.",
Mobile.GetAccessLevelName(neededAccess),
accessType))
{
}
示例3: AdminProject
public AdminProject(
int projectId,
string name,
ProjectType[] projectType,
string info,
ProjectStatus projectStatus,
Common.Image landingImage,
AccessLevel accessLevel,
Uri versionControlSystemUri,
Uri projectManagementSystemUri,
HashSet<Issue> issues,
HashSet<ProjectMembership> projectDevelopers,
HashSet<Common.Image> screenshots)
{
Require.Positive(projectId, nameof(projectId));
Require.NotEmpty(name, nameof(name));
Require.NotNull(info, nameof(info));
Require.NotNull(versionControlSystemUri, nameof(versionControlSystemUri));
Require.NotNull(projectManagementSystemUri, nameof(projectManagementSystemUri));
ProjectId = projectId;
Name = name;
ProjectType = projectType ?? new[] {Common.ProjectType.Other};
AccessLevel = accessLevel;
Info = info;
ProjectStatus = projectStatus;
LandingImage = landingImage;
VersionControlSystemUri = versionControlSystemUri;
ProjectManagementSystemUri = projectManagementSystemUri;
Issues = issues ?? new HashSet<Issue>();
ProjectMemberships = projectDevelopers ?? new HashSet<ProjectMembership>();
Screenshots = screenshots ?? new HashSet<Common.Image>();
}
示例4: TypeDefinitionStatement
public TypeDefinitionStatement(AccessLevel accessLevel, String name) : base(StatementType.TypeDefinition)
{
statements = new ASTNodeCollection(this);
this.accessLevel = accessLevel;
this.name = name;
}
示例5: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (m_User == from && from.AccessLevel == AccessLevel.Player)
{
try
{
from.AccessLevel = m_AL;
m_User = null;
m_AL = AccessLevel.Player;
if ( !from.Alive )
{
from.Hidden = true;
from.Resurrect();
}
}
catch
{
from.SendMessage("An error occurred... Contact your supervisor or something! Don't stand there. I get so tired of people like you, gosh.");
}
}
else if (m_User == null && from.AccessLevel > AccessLevel.Player)
{
m_AL = from.AccessLevel;
m_User = from;
from.AccessLevel = AccessLevel.Player;
if ( from.Backpack != null && (!this.IsChildOf(from) || !this.IsAccessibleTo(from)))
from.Backpack.DropItem(this);
}
else
{
from.SendMessage("You can't use this...");
}
}
示例6: UpdatedAccessLevelEventArgsConstructorTest
public void UpdatedAccessLevelEventArgsConstructorTest()
{
AccessLevel oldAccessLevel = new AccessLevel(); // TODO: 初始化为适当的值
BaseCharacter character = null; // TODO: 初始化为适当的值
UpdatedAccessLevelEventArgs target = new UpdatedAccessLevelEventArgs( oldAccessLevel, character );
Assert.Inconclusive( "TODO: 实现用来验证目标的代码" );
}
示例7: IsGranted
public bool IsGranted(AccessComponent component, AccessLevel requiredLevel)
{
AccessLevel storedLevel;
if (!AccessDict.TryGetValue(component, out storedLevel)) return false;
return storedLevel >= requiredLevel;
}
示例8: GetTDSMCommandsForAccessLevel
public static IEnumerable<TDSMCommandInfo> GetTDSMCommandsForAccessLevel(this OTA.Commands.CommandParser parser, AccessLevel accessLevel)
{
return OTA.Commands.CommandManager.Parser.commands
.Where(x => x.Value is TDSMCommandInfo)
.Select(y => y.Value as TDSMCommandInfo)
.Where(z => z._accessLevel.HasValue && z._accessLevel == accessLevel);
}
示例9: Project
public Project(
string name,
ISet<ProjectType> projectTypes,
string info,
ProjectStatus projectStatus,
Image landingImage,
AccessLevel accessLevel,
VersionControlSystemInfo versionControlSystemInfo,
RedmineProjectInfo redmineProjectInfo,
ISet<Issue> issues,
ISet<ProjectMembership> projectDevelopers,
ISet<Image> screenshots)
{
Require.NotEmpty(name, nameof(name));
Require.NotNull(info, nameof(info));
Require.NotNull(versionControlSystemInfo, nameof(versionControlSystemInfo));
Require.NotNull(redmineProjectInfo, nameof(redmineProjectInfo));
Require.NotEmpty(projectTypes, nameof(projectTypes));
Name = name;
ProjectTypes = projectTypes;
AccessLevel = accessLevel;
Info = info;
ProjectStatus = projectStatus;
LandingImage = landingImage;
VersionControlSystemInfo = versionControlSystemInfo;
RedmineProjectInfo = redmineProjectInfo;
Issues = issues ?? new HashSet<Issue>();
ProjectMemberships = projectDevelopers ?? new HashSet<ProjectMembership>();
Screenshots = screenshots ?? new HashSet<Image>();
}
示例10: ComponentInfo
public ComponentInfo(Component component, AccessLevel access)
{
ComponentId = component.ComponentId;
Name = component.ComponentName;
IsReadOnlyAccess = component.IsReadOnlyAccess;
AccessLevel = access;
}
示例11: Broadcast
//Use only ASCII messages, not unicode.
public static void Broadcast( AccessLevel level, int font, int hue, string text, string channel )
{
ArrayList mobiles = NetState.Instances;
for( int i = 0; i < mobiles.Count; i++ )
BroadcastTo( (NetState)mobiles[i], level, font, hue, text );
}
示例12: UserAccount
//protected bool Equals(UserAccount other)
//{
// return this.IsActive.Equals(other.IsActive)
// && string.Equals(this.Id, other.Id)
// && string.Equals(this.FirstName, other.FirstName)
// && string.Equals(this.LastName, other.LastName)
// && this.AccessLevel == other.AccessLevel;
//}
//public override bool Equals(object obj)
//{
// if (ReferenceEquals(null, obj))
// {
// return false;
// }
// if (ReferenceEquals(this, obj))
// {
// return true;
// }
// if (obj.GetType() != this.GetType())
// {
// return false;
// }
// return Equals((UserAccount)obj);
//}
//public override int GetHashCode()
//{
// unchecked
// {
// int hashCode = this.IsActive.GetHashCode();
// hashCode = (hashCode * 397) ^ (this.Id != null ? this.Id.GetHashCode() : 0);
// hashCode = (hashCode * 397) ^ (this.FirstName != null ? this.FirstName.GetHashCode() : 0);
// hashCode = (hashCode * 397) ^ (this.LastName != null ? this.LastName.GetHashCode() : 0);
// hashCode = (hashCode * 397) ^ (int)this.AccessLevel;
// return hashCode;
// }
//}
//public static bool operator ==(UserAccount left, UserAccount right)
//{
// return Equals(left, right);
//}
//public static bool operator !=(UserAccount left, UserAccount right)
//{
// return !Equals(left, right);
//}
public UserAccount(int id, string firstName, string lastName, AccessLevel accessLevel)
{
Id = id;
FirstName = firstName;
LastName = lastName;
AccessLevel = accessLevel;
}
示例13: Access
public static void Access( string command, AccessLevel level )
{
try{
if ( Server.Commands.Entries[command] == null )
return;
DefaultInfo info = new DefaultInfo();
if ( !HasMod( command ) )
{
info = new DefaultInfo();
info.OldCommand = command;
info.NewCommand = command;
info.NewAccess = level;
info.OldAccess = ((CommandEntry)Server.Commands.Entries[command]).AccessLevel;
s_Defaults[command] = info;
}
else
{
info = (DefaultInfo)s_Defaults[command];
info.NewAccess = level;
}
CommandEntry entry = new CommandEntry( command, ((CommandEntry)Server.Commands.Entries[command]).Handler, info.NewAccess );
Server.Commands.Entries[command] = entry;
foreach( BaseCommandImplementor imp in BaseCommandImplementor.Implementors )
foreach( string str in new ArrayList( imp.Commands.Keys ) )
if ( str == command )
((BaseCommand)imp.Commands[str]).AccessLevel = info.NewAccess;
}catch{ Errors.Report( "Commands-> Access-> AccessLevel" ); }
}
示例14: Initialize
public static void Initialize()
{
m_Threads = new ArrayList();
m_Moderators = new ArrayList();
m_PlayerStatistics = new Hashtable();
Server.EventSink.WorldSave += new WorldSaveEventHandler( EventSink_WorldSave );
CommandSystem.Register( "Forum", AccessLevel.Player, new CommandEventHandler( ViewForums_OnCommand ) );
CommandSystem.Register( "Forums", AccessLevel.Player, new CommandEventHandler( ViewForums_OnCommand ) );
Console.Write( "Ingame Forums: " );
if( File.Exists( Path.Combine( m_SavePath, "forumdata.sig" ) ) )
{
Load();
}
else
{
Console.WriteLine( "No save file was found. Using default settings." );
m_ThreadLockAccesLevel = AccessLevel.GameMaster;
m_ThreadDeleteAccessLevel = AccessLevel.Administrator;
m_AutoCleanup = false;
m_AutoCleanupDays = 30;
m_MinPostCharactersCount = 5;
m_MaxPostCharactersCount = 10000;
}
}
示例15: OnEquip
public override bool OnEquip(Mobile from)
{
m_Wearer = from;
m_PrevLevel = from.AccessLevel;
from.AccessLevel = AccessLevel.Player;
return true;
}