当前位置: 首页>>代码示例>>C#>>正文


C# AccessLevel类代码示例

本文整理汇总了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;
 }
开发者ID:Aralcom,项目名称:Parking,代码行数:14,代码来源:ApiAttribute.cs

示例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))
 {
 }
开发者ID:FreeReign,项目名称:forkuo,代码行数:7,代码来源:Properties.cs

示例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>();
        }
开发者ID:LeagueOfDevelopers,项目名称:LodCore,代码行数:33,代码来源:AdminProject.cs

示例4: TypeDefinitionStatement

		public TypeDefinitionStatement(AccessLevel accessLevel, String name) : base(StatementType.TypeDefinition)
		{
			statements = new ASTNodeCollection(this);

			this.accessLevel = accessLevel;
			this.name = name;
		}
开发者ID:ralescano,项目名称:castle,代码行数:7,代码来源:TypeDefinitionStatement.cs

示例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...");
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:35,代码来源:PlayerMaker.cs

示例6: UpdatedAccessLevelEventArgsConstructorTest

 public void UpdatedAccessLevelEventArgsConstructorTest()
 {
     AccessLevel oldAccessLevel = new AccessLevel(); // TODO: 初始化为适当的值
     BaseCharacter character = null; // TODO: 初始化为适当的值
     UpdatedAccessLevelEventArgs target = new UpdatedAccessLevelEventArgs( oldAccessLevel, character );
     Assert.Inconclusive( "TODO: 实现用来验证目标的代码" );
 }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:7,代码来源:UpdatedAccessLevelEventArgsTest.cs

示例7: IsGranted

        public bool IsGranted(AccessComponent component, AccessLevel requiredLevel)
        {
            AccessLevel storedLevel;
            if (!AccessDict.TryGetValue(component, out storedLevel)) return false;

            return storedLevel >= requiredLevel;
        }
开发者ID:urise,项目名称:JohanCorner,代码行数:7,代码来源:UserAccess.cs

示例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);
 }
开发者ID:DeathCradle,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:7,代码来源:CommandExtensions.cs

示例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>();
        }
开发者ID:LeagueOfDevelopers,项目名称:LodCore,代码行数:31,代码来源:Project.cs

示例10: ComponentInfo

 public ComponentInfo(Component component, AccessLevel access)
 {
     ComponentId = component.ComponentId;
     Name = component.ComponentName;
     IsReadOnlyAccess = component.IsReadOnlyAccess;
     AccessLevel = access;
 }
开发者ID:urise,项目名称:MvcRestPattern,代码行数:7,代码来源:ComponentInfo.cs

示例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 );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:8,代码来源:AutoRestart.cs

示例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;
 }
开发者ID:joomnet,项目名称:SkillSignal,代码行数:51,代码来源:UserAccount.cs

示例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" ); }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:34,代码来源:Commands.cs

示例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;
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:27,代码来源:ForumCore.cs

示例15: OnEquip

		public override bool OnEquip(Mobile from)
		{
			m_Wearer = from;
			m_PrevLevel = from.AccessLevel;
			from.AccessLevel = AccessLevel.Player;
			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:Cloaks.cs


注:本文中的AccessLevel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。