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


C# ShareCacheStruct.GetPaging方法代码示例

本文整理汇总了C#中ShareCacheStruct.GetPaging方法的典型用法代码示例。如果您正苦于以下问题:C# ShareCacheStruct.GetPaging方法的具体用法?C# ShareCacheStruct.GetPaging怎么用?C# ShareCacheStruct.GetPaging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShareCacheStruct的用法示例。


在下文中一共展示了ShareCacheStruct.GetPaging方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetNotices

 public GameNotice[] GetNotices(int pageIndex, int pageSize, out int recordCount)
 {
     recordCount = 0;
     try
     {
         List<GameNotice> list = new ShareCacheStruct<GameNotice>().FindAll();
         list.QuickSort((x, y) =>
         {
             int result = y.IsTop.CompareTo(x.IsTop);
             if (result == 0)
             {
                 return y.CreateDate.CompareTo(x.CreateDate);
             }
             return result;
         });
         var tempList = list.GetPaging(pageIndex, pageSize, out recordCount);
         return tempList.ToArray();
     }
     catch (Exception ex)
     {
         new BaseLog().SaveLog("取公告出错:", ex);
         throw;
     }
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:24,代码来源:OAService.asmx.cs

示例2: TakeAction

        public override bool TakeAction()
        {

            List<UserFriends> userFriendsesArray = new ShareCacheStruct<UserFriends>().FindAll(m => m.UserID == ContextUser.UserID && m.FriendType == _friendType);
            userFriendsesArray.QuickSort((x, y) =>
            {
                if (x == null && y == null) return 0;
                if (x != null && y == null) return 1;
                if (x == null) return -1;
                //普通的玩家根据等级来排序 如果是仇敌的话需要用最后战斗时间来排序
                int result = 0;
                if (_friendType != FriendType.ChouDi)
                {
                    GameUser userx = new PersonalCacheStruct<GameUser>().FindKey(x.UserID);
                    GameUser usery = new PersonalCacheStruct<GameUser>().FindKey(y.UserID);
                    int userLvx = userx == null ? 0 : userx.UserLv;
                    int userLvy = usery == null ? 0 : usery.UserLv;
                    int currExperiencex = (UserGeneral.GetMainGeneral(x.UserID) ?? new UserGeneral()).CurrExperience;
                    int currExperiencey = (UserGeneral.GetMainGeneral(y.UserID) ?? new UserGeneral()).CurrExperience;
                    result = userLvy.CompareTo(userLvx);
                    if (result == 0)
                    {
                        result = currExperiencey.CompareTo(currExperiencex);
                    }

                }
                else
                {
                    result = x.FightTime.CompareTo(y.FightTime);
                    if (result == 0)
                    {
                        result = x.UserID.CompareTo(y.UserID);
                    }
                }
                return result;
            });
            _userFriendList = userFriendsesArray.GetPaging(_pageIndex, _pageSize, out _pageCount);
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:39,代码来源:Action9101.cs

示例3: TakeAction

 public override bool TakeAction()
 {
     FightCombat combat = new FightCombat();
     var serverFightList = new ShareCacheStruct<ServerFight>().FindAll(s => s.FastID == combat.FastID && !s.IsRemove);
     serverFightList.QuickSort((x, y) =>
     {
         int result;
         if (x == null && y == null) return 0;
         if (x != null && y == null) return 1;
         if (x == null) return -1;
         result = x.CityID.CompareTo(y.CityID);
         if (result == 0)
         {
             var userGuildA = new ShareCacheStruct<UserGuild>().FindKey(x.GuildID);
             var userGuildB = new ShareCacheStruct<UserGuild>().FindKey(y.GuildID);
             if (userGuildA != null && userGuildB != null)
             {
                 result = userGuildB.GuildLv.CompareTo(userGuildA.GuildLv);
                 if (result == 0)
                 {
                     result = userGuildB.CurrExperience.CompareTo(userGuildA.CurrExperience);
                 }
             }
         }
         return result;
     });
     fightList = serverFightList.GetPaging(pageIndex, pageSize, out pageCount);
     rankID = (short)(MathUtils.Subtraction(pageIndex, 1) * 5);
     return true;
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:30,代码来源:Action6403.cs

示例4: TakeAction

        public override bool TakeAction()
        {
            ServerFightGroup fightGroup = new ShareCacheStruct<ServerFightGroup>().FindKey(combatID);
            if (fightGroup != null)
            {
                guildName1 = GuildFightCombat.GuildName(fightGroup.GuildIDA);
                guildName2 = GuildFightCombat.GuildName(fightGroup.GuildIDB);
                guildName3 = GuildFightCombat.GuildName(fightGroup.WinGuildID);
                var groupList =
                    new ShareCacheStruct<MemberGroup>().FindAll(s => !s.IsRemove && s.FastID == fightGroup.FastID && s.GuildIDA == fightGroup.GuildIDA && s.GuildIDB == fightGroup.GuildIDB);

                foreach (MemberGroup member in groupList)
                {
                    if (member.GuildIDA == fightGroup.WinGuildID)
                    {
                        member.IsEnemy = true;
                    }
                    else
                    {
                        member.IsEnemy = false;
                    }
                    if (member.Win)
                    {
                        member.ConquerMember = member.UserIDA;
                        member.DefeatMember = member.UserIDB;
                    }
                    else
                    {
                        member.ConquerMember = member.UserIDB;
                        member.DefeatMember = member.UserIDA;
                    }
                }
                memberGroupList = groupList.GetPaging(pageIndex, pageSize, out pageCount);
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:36,代码来源:Action6407.cs


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