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


C# List.Remove方法代码示例

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


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

示例1: SetupList

        public void SetupList(Player player, List<Team> listOfTeams )
        {

            ListWithOutAdded = new List<Team>();
            foreach (var team in listOfTeams)
            {
                ListWithOutAdded.Add(team);
            }
             TeamsAdded = player.Teams;
            foreach (var tm in listOfTeams)
            {
                foreach (var tmA in TeamsAdded)
                {
                    if (tm.Id == tmA.Id)
                    {
                        ListWithOutAdded.Remove(tm);
                    }
                }
            }
            
        }
开发者ID:theklausster,项目名称:DragonsLair,代码行数:21,代码来源:PlayerModel.cs

示例2: RemoveBook

        /// <summary>
        /// Removes some book from repository (if this book was there)
        /// </summary>
        /// <param name="book">Some book to remove</param>
        public void RemoveBook(Book book)
        {
            try
            {
                if (book == null)
                    throw new ArgumentException("Book is null");

                books = repository.LoadToList();
                if (!books.Contains(book))
                    throw new ArgumentException("There is no this book in booklist");
                else
                {
                    books.Remove(book);
                    logger.Info("Book was removed successfully");
                    repository.LoadToFile(books);
                }
            }
            catch (Exception e)
            {
                logger.Info(e.Message);
                logger.Error(e.StackTrace);
            }
        }
开发者ID:zzhukanton,项目名称:BSU.ASP1501.Day5.Zhuk,代码行数:27,代码来源:BookList.cs

示例3: ParseTags

 private IEnumerable<String> ParseTags(String tags)
 {
     var tagsList =new  List<String>(Regex.Split(Regex.Replace(tags, @"\s\s+", @"\s"), @"\s*,\s+"));
     tagsList.Remove("");
     return tagsList;
 }
开发者ID:dimonKomaran,项目名称:course,代码行数:6,代码来源:TasksProvider.cs

示例4: UniquePaypalUserInBasket

 public void UniquePaypalUserInBasket(ref List<Basket> allBasket, int EventId)
 {
     Events eventAdded = db.Events.FirstOrDefault(e => e.EventsId == EventId);
     foreach (Basket b in allBasket)
     {
         if (eventAdded.PaypalEmail != b.Event.PaypalEmail)
         {
             RemoveProduct(b.EventId);
             allBasket.Remove(b);
         }
     }
 }
开发者ID:johncoffee,项目名称:eventblock,代码行数:12,代码来源:OrdersLogic.cs

示例5: c_ClientAcceptImbueItemInfo


//.........这里部分代码省略.........
                    {
                        byte[] cannotbeImbued = PacketManager.SendImbueMessage(ImbueError.ImbueImpossible, ImbueStat.None, 0, Item);
                        c.Send(cannotbeImbued);
                        return;
                    }

                    value += (int)(((value * 0.1) * Item.Slvl) + ((imbueitem.ImbueChance / 5) * Item.Slvl));
                    WhiteStats = new List<ImbueStat>();
                    WhiteStats.Add(ImbueStat.Damage);
                    WhiteStats.Add(ImbueStat.Defense);
                    WhiteStats.Add(ImbueStat.AttackRating);
                    WhiteStats.Add(ImbueStat.MaxLife);
                    WhiteStats.Add(ImbueStat.MaxMana);
                    WhiteStats.Add(ImbueStat.LifeReg);
                    WhiteStats.Add(ImbueStat.ManaReg);
                    WhiteStats.Add(ImbueStat.CriticalHit);

                    if (XiahRandom.PercentSuccess(SuccessChance - Item.Slvl * 4))
                    {
                        value = gameEngine.WhiteImbue(Item, ref stat, imbueitem);
                        Item.Slvl++;
                        error = ImbueError.Success;
                    }
                    else
                    {
                        error = ImbueError.FailedToRemake;
                        stat = ImbueStat.None;

                        if (Item.Slvl >= 4 && XiahRandom.PercentSuccess(Item.Slvl * 2))
                        {
                            Item.Slvl--;
                            if (Item is Cape)
                            {
                                WhiteStats.Remove(ImbueStat.Damage);
                                WhiteStats.Remove(ImbueStat.Defense);

                                if (Item.AttackRating == 0)
                                    WhiteStats.Remove(ImbueStat.AttackRating);
                                if (Item.IncMaxLife == 0)
                                    WhiteStats.Remove(ImbueStat.MaxLife);
                                if (Item.IncMaxMana == 0)
                                    WhiteStats.Remove(ImbueStat.MaxMana);
                                if (Item.IncLifeRegen == 0)
                                    WhiteStats.Remove(ImbueStat.LifeReg);
                                if (Item.IncManaRegen == 0)
                                    WhiteStats.Remove(ImbueStat.ManaReg);
                                if (Item.Critical == 0)
                                    WhiteStats.Remove(ImbueStat.CriticalHit);
                            }
                            if (Item is Hand)
                            {
                                WhiteStats.Remove(ImbueStat.Damage);

                                if (Item.Defence == 0)
                                    WhiteStats.Remove(ImbueStat.Defense);
                                if (Item.AttackRating == 0)
                                    WhiteStats.Remove(ImbueStat.AttackRating);
                                if (Item.IncMaxLife == 0)
                                    WhiteStats.Remove(ImbueStat.MaxLife);
                                if (Item.IncMaxMana == 0)
                                    WhiteStats.Remove(ImbueStat.MaxMana);
                                if (Item.IncLifeRegen == 0)
                                    WhiteStats.Remove(ImbueStat.LifeReg);
                                if (Item.IncManaRegen == 0)
                                    WhiteStats.Remove(ImbueStat.ManaReg);
                                if (Item.Critical == 0)
开发者ID:zarut,项目名称:xiah-gcf-emulator,代码行数:67,代码来源:ChannelServer.cs

示例6: WhiteImbue

        public int WhiteImbue(Equipment Item, ref ImbueStat stat, ImbueItem imbueitem)
        {
            int value = (int)(Item.RequiredLevel);
            value += (int)(((value * 0.1) * Item.Slvl) + ((imbueitem.ImbueChance / 5) * Item.Slvl));

            List<ImbueStat> WhiteStats = new List<ImbueStat>();
            WhiteStats.Add(ImbueStat.Damage);
            WhiteStats.Add(ImbueStat.Defense);
            WhiteStats.Add(ImbueStat.AttackRating);
            WhiteStats.Add(ImbueStat.MaxLife);
            WhiteStats.Add(ImbueStat.MaxMana);
            WhiteStats.Add(ImbueStat.LifeReg);
            WhiteStats.Add(ImbueStat.ManaReg);
            WhiteStats.Add(ImbueStat.CriticalHit);

            if (Item is Cape)
            {
                WhiteStats.Remove(ImbueStat.Damage);
                WhiteStats.Remove(ImbueStat.Defense);
            }
            if (Item is Hand)
            {
                Hand weapon = Item as Hand;
                WhiteStats.Remove(weapon.NotWithWhite);
            }
            if (Item is Head)
            {
                Head hat = Item as Head;
                WhiteStats.Remove(hat.NotWithWhite);
            }
            if (Item is Body)
            {
                Body armor = Item as Body;
                WhiteStats.Remove(armor.NotWithWhite);
            }
            if (Item is Ring)
            {
                Ring ring = Item as Ring;
                value *= (int)2.94;
            }
            if (Item is Necklace)
            {
                Necklace neck = Item as Necklace;
                value *= (int)1.85;
            }

            if (imbueitem.ImbueData == 0)
            {
                int randomStat = Random.Next(0, WhiteStats.Count);
                stat = WhiteStats[randomStat];
            }
            else
            {
                switch (imbueitem.ImbueData)
                {
                    case 2:
                        stat = ImbueStat.Damage;
                        break;
                    case 3:
                        stat = ImbueStat.Defense;
                        break;

                    case 4:
                        stat = ImbueStat.AttackRating;
                        break;

                    case 5:
                        stat = ImbueStat.CriticalHit;
                        break;

                    case 6:
                        stat = ImbueStat.MaxLife;
                        break;

                    case 7:
                        stat = ImbueStat.MaxMana;
                        break;

                    case 8:
                        stat = ImbueStat.LifeReg;
                        break;

                    case 9:
                        stat = ImbueStat.ManaReg;
                        break;

                    default:
                        stat = ImbueStat.CriticalHit;
                        break;
                }
            }
            switch (stat)
            {
                case ImbueStat.Damage:
                    Item.Damage += (short)value;
                    break;

                case ImbueStat.Defense:
                    Item.Defence += (short)value;
                    break;
//.........这里部分代码省略.........
开发者ID:zarut,项目名称:xiah-gcf-emulator,代码行数:101,代码来源:GameEngine.cs

示例7: grvKhuyenMaiSL_CellDoubleClick

 /// <summary>
 /// grvKhuyenMaiSL_CellDoubleClick
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void grvKhuyenMaiSL_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         // Lay source
         Entities.KhuyenMaiSoLuong[] source = (Entities.KhuyenMaiSoLuong[])grvKhuyenMaiSL.DataSource;
         List<Entities.KhuyenMaiSoLuong> list = new List<Entities.KhuyenMaiSoLuong>();
         list = source.ToList();
         // lay item khi click
         Entities.KhuyenMaiSoLuong item = (Entities.KhuyenMaiSoLuong)grvKhuyenMaiSL.Rows[e.RowIndex].DataBoundItem;
         // remove item trong list
         list.Remove(item);
         // nhet data vao control
         SetData(item);
         // nhet data vao list view
         grvKhuyenMaiSL.DataSource = list.ToArray();
     }
     catch
     {
     }
 }
开发者ID:mrk29vn,项目名称:vna-accounting,代码行数:26,代码来源:frmXuLyHangHoa.cs


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