Exemplo n.º 1
0
 public static void PersonnelTriMatricule(bool ascendant) //Tri par matricule
 {
     if (!ascendant)
     {
         List <Personnel> orderedListDescending = listePersonnel.OrderByDescending(personnel => personnel.matricule).ToList();
         listePersonnel = new SortableBindingList <Personnel>(orderedListDescending);
     }
     else
     {
         List <Personnel> orderedList = listePersonnel.OrderBy(personnel => personnel.matricule).ToList();
         listePersonnel = new SortableBindingList <Personnel>(orderedList);
     }
 }
Exemplo n.º 2
0
        //public static List<Monstre> MonstreTriCagnotte(bool ascendant) //Tri des monstres par cagnotte
        //{
        //    List<Monstre> listeMonstres = ListeMonstres();
        //    if (!ascendant)
        //    {
        //        List<Monstre> orderedListDescending = listeMonstres.OrderByDescending(monstre => monstre.cagnotte).ToList();
        //        listeMonstres = new List<Monstre>(orderedListDescending);
        //        return listeMonstres;

        //    }
        //    else
        //    {
        //        List<Monstre> orderedList = listeMonstres.OrderBy(monstre => monstre.cagnotte).ToList();
        //        listeMonstres = new SortableBindingList<Monstre>(orderedList);
        //        return listeMonstres;
        //    }

        //}
        public static void AttractionTriIdentifiant(bool ascendant) //Tri par ID
        {
            if (!ascendant)
            {
                List <Attraction> orderedListDescending = listeAttractions.OrderByDescending(attraction => attraction.identifiant).ToList();
                listeAttractions = new SortableBindingList <Attraction>(orderedListDescending);
            }
            else
            {
                List <Attraction> orderedList = listeAttractions.OrderBy(attraction => attraction.identifiant).ToList();
                listeAttractions = new SortableBindingList <Attraction>(orderedList);
            }
        }
Exemplo n.º 3
0
        public async Task Refresh(MarketService marketService)
        {
            await GetCoinApi();

            if (!string.IsNullOrEmpty(ShortName))
            {
                var priceList = await marketService.GetPricesFullAsync(this);

                Prices = new SortableBindingList <MarketPrice>(priceList);
                if (Prices.Count > 0)
                {
                    ActualPrice = Prices.OrderByDescending(p => p.Volume).FirstOrDefault().Price;
                }

                //var t1 = marketService.GetPricesFullAsync(this);

                //var t2 = t1.ContinueWith((priceList) =>
                //{
                //    if (priceList.Result.Count > 0)
                //        ActualPrice = priceList.Result.OrderByDescending(p => p.Volume).FirstOrDefault().Price;
                //});
                //await t2;
                //Prices = new SortableBindingList<MarketPrice>(t1.Result);
            }
        }
Exemplo n.º 4
0
        // copying log to cliboard
        private void exportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var list = new BindingList <DamageMeterRow>(AttackerList.OrderByDescending(x => x.DamageSum).ToList());
            var s    = "";

            foreach (var a in list)
            {
                s += $"{a.Name} | {a.DamageSum} | {a.DamagePercent.ToString("P1", CultureInfo.CurrentCulture)} | {a.MaxHit}\n";
            }
            if (s != "")
            {
                s = s.Remove(s.Length - 1);
                var result = "Name | Damage | % | Max Hit\n" + s;
                Clipboard.SetText(result);
            }
        }