Exemplo n.º 1
0
        public void Fetch()
        {
            Task.Run(async() =>
            {
                var res = await Podcast.GetiTunesTop(15);

                await CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
                {
                    TopList.Clear();
                    foreach (var item in res)
                    {
                        TopList.Add(new GenericMusicItemViewModel(item));
                    }
                });
            });
            Task.Run(async() =>
            {
                foreach (var g in genres)
                {
                    await CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, async() =>
                    {
                        var p = new PodcastGroup
                        {
                            Title   = g.Key,
                            GenreID = g.Value
                        };
                        Genres.Add(p);
                        await p.GetItems(15);
                    });
                }
            });
        }
Exemplo n.º 2
0
        public void RPC_GetTopAndFriend(ulong roleId, ushort planesId, Iocp.NetConnection connect, RPC.RPCForwardInfo fwd)
        {
            RPC.PackageWriter pkg = new RPC.PackageWriter();
            TopList.Clear();
            FriendList.Clear();
            var role = this.GetRole(roleId);

            if (role == null)
            {
                Log.Log.Server.Print("RPC_GetTopAndFriend role is null , {0}", roleId);
                pkg.Write((sbyte)-1);
                pkg.DoReturnCommand2(connect, fwd.ReturnSerialId);
                return;
            }
            pkg.Write((sbyte)1);
            InitVisitTimes(role);
            pkg.Write(role.RoleData.WorldVisitCount);
            pkg.Write(role.RoleData.FriendVisitCount);
            pkg.Write(role.RoleData.BuyVisitCount);
            pkg.Write(role.RoleData.ByVisitCount);
            List <RankData> rds = _GetFightTopPlayer(planesId);

            pkg.Write((byte)rds.Count);
            foreach (var i in rds)
            {
                pkg.Write(i.RoleId);
                pkg.Write(i.RoleName);
                if (role.VisitTopList.Contains(i.RoleId))
                {
                    pkg.Write((byte)CSCommon.eBoolState.True);
                }
                else
                {
                    pkg.Write((byte)CSCommon.eBoolState.False);
                }
                TopList.Add(i.RoleId);
            }
            UpdateSocialInfoList(CSCommon.eSocialType.Friend, role);
            pkg.Write((byte)role.mSocialInfoList.Count);
            foreach (var j in role.mSocialInfoList.Values)
            {
                pkg.Write(j.id);
                pkg.Write(j.name);
                if (role.VisitFriendList.Contains(j.id))
                {
                    pkg.Write((byte)CSCommon.eBoolState.True);
                }
                else
                {
                    pkg.Write((byte)CSCommon.eBoolState.False);
                }
                FriendList.Add(j.id);
            }
            pkg.DoReturnCommand2(connect, fwd.ReturnSerialId);
        }
        public void UpdateTopList()
        {
            _allTransaction = _transactionService.GetTransactions();
            TopList.Clear();
            if (IsMontly)
            {
                foreach (var month in (DateTimeFormatInfo.CurrentInfo?.MonthNames).Where(month => !string.IsNullOrEmpty(month)))
                {
                    TopList.Add(new RowModel {
                        RowName = month
                    });
                }
            }
            else
            {
                int thisYear = int.Parse(DateTime.Now.ToString(SumBy));
                for (int i = thisYear; i > thisYear - 12; i--)
                {
                    TopList.Add(new RowModel {
                        RowName = i.ToString()
                    });
                }
            }
            foreach (var transaction in _allTransaction)
            {
                if (TopList.All(e => e.RowName != transaction.CreatedTime.ToString(SumBy)))
                {
                    TopList.Add(new RowModel {
                        RowName = transaction.CreatedTime.ToString(SumBy)
                    });
                }
                switch (transaction.Type)
                {
                case BaseModel.TypeEnum.Income:
                    TopList.First(e => e.RowName == transaction.CreatedTime.ToString(SumBy)).Num1 += transaction.Value;
                    break;

                case BaseModel.TypeEnum.Expense:
                    TopList.First(e => e.RowName == transaction.CreatedTime.ToString(SumBy)).Num2 += transaction.Value;
                    break;
                }
            }
        }
Exemplo n.º 4
0
        public TopListViewModel(List <MovieDTO> mostVoted, List <MovieDTO> bestRated)
        {
            for (int i = 0; i < 4; i++)
            {
                DateTime date;

                if (DateTime.TryParse(mostVoted[i].Released, out date))
                {
                    mostVoted[i].Released = date.ToString("yyyy");
                }

                if (mostVoted[i].Poster == "N/A")
                {
                    mostVoted[i].Poster = "../images/posterlessPoster.png";
                }
                if (mostVoted[i].Plot == "N/A")
                {
                    mostVoted[i].Plot = "This movie doesn't have a plot.";
                }
                TopList.Add(mostVoted[i]);
            }
            for (int i = 0; i < 4; i++)
            {
                DateTime date;

                if (DateTime.TryParse(bestRated[i].Released, out date))
                {
                    bestRated[i].Released = date.ToString("yyyy");
                }

                if (bestRated[i].Poster == "N/A")
                {
                    bestRated[i].Poster = "../images/posterlessPoster.png";
                }
                if (bestRated[i].Plot == "N/A")
                {
                    bestRated[i].Plot = "This movie doesn't have a plot.";
                }
                TopList.Add(bestRated[i]);
            }
            Toplists.Add("Most voted");
            Toplists.Add("Best rated");
        }
Exemplo n.º 5
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
            #region list addings
            MarksmanList.Add("Ashe");
            MarksmanList.Add("Caitlyn");
            MarksmanList.Add("Corki");
            MarksmanList.Add("Draven");
            MarksmanList.Add("Ezreal");
            MarksmanList.Add("Graves");
            MarksmanList.Add("Kog'Maw");
            MarksmanList.Add("Lucian");
            MarksmanList.Add("Miss Fortune");
            MarksmanList.Add("Quinn");
            MarksmanList.Add("Sivir");
            MarksmanList.Add("Teemo");
            MarksmanList.Add("Tristana");
            MarksmanList.Add("Twitch");
            MarksmanList.Add("Urgot");
            MarksmanList.Add("Varus");
            MarksmanList.Add("Vayne");
            MidList.Add("Ahri");
            MidList.Add("Anivia");
            MidList.Add("Annie");
            MidList.Add("Brand");
            MidList.Add("Cassiopeia");
            MidList.Add("Elise");
            MidList.Add("Fiddlesticks");
            MidList.Add("Gragas");
            MidList.Add("Heimerdinger");
            MidList.Add("Karma");
            MidList.Add("Karthus");
            MidList.Add("Kennen");
            MidList.Add("Lissandra");
            MidList.Add("Lux");
            MidList.Add("Malzahar");
            MidList.Add("Morgana");
            MidList.Add("Orianna");
            MidList.Add("Ryze");
            MidList.Add("Swain");
            MidList.Add("Syndra");
            MidList.Add("Twisted Fate");
            MidList.Add("Veigar");
            MidList.Add("Viktor");
            MidList.Add("Vladimir");
            MidList.Add("Xerath");
            MidList.Add("Ziggs");
            MidList.Add("Zyra");
            MidList.Add("Janna");
            MidList.Add("Katarina");
            MidList.Add("Kassadin");
            MidList.Add("Evelynnn");
            MidList.Add("Kog'Maw");
            MidList.Add("LeBlanc");
            MidList.Add("Akali");
            MidList.Add("Jayce");
            MidList.Add("Kha'Zix");
            MidList.Add("Talon");
            MidList.Add("Teemo");
            MidList.Add("Tristana");
            MidList.Add("Zilean");
            MidList.Add("Nidalee");
            MidList.Add("Zed");
            MidList.Add("Sion");
            MidList.Add("Diana");
            MidList.Add("Ezreal");
            MidList.Add("Fizz");
            MidList.Add("Galio");
            MidList.Add("Kayle");
            MidList.Add("Kennen");
            MidList.Add("Lee Sin");
            MidList.Add("Pantheon");
            TopList.Add("Aatrox");
            TopList.Add("Akali");
            TopList.Add("Cho'Gath");
            TopList.Add("Darius");
            TopList.Add("Diana");
            TopList.Add("Elise");
            TopList.Add("Evelynn");
            TopList.Add("Ezreal");
            TopList.Add("Fiora");
            TopList.Add("Fizz");
            TopList.Add("Galio");
            TopList.Add("Gangplank");
            TopList.Add("Garen");
            TopList.Add("Irelia");
            TopList.Add("Jarvan IV");
            TopList.Add("Jax");
            TopList.Add("Jayce");
            TopList.Add("Kayle");
            TopList.Add("Kennen");
            TopList.Add("Kha'Zix");
            TopList.Add("Lee Sin");
            TopList.Add("Lissandra");
            TopList.Add("Malphite");
            TopList.Add("Master Yi");
            TopList.Add("Mordekaiser");
            TopList.Add("Nasus");
            TopList.Add("Nidalee");
            TopList.Add("Olaf");
            TopList.Add("Pantheon");
            TopList.Add("Poppy");
            TopList.Add("Renekton");
            TopList.Add("Rengar");
            TopList.Add("Riven");
            TopList.Add("Rumble");
            TopList.Add("Ryze");
            TopList.Add("Shen");
            TopList.Add("Shyvana");
            TopList.Add("Singed");
            TopList.Add("Sion");
            TopList.Add("Swain");
            TopList.Add("Teemo");
            TopList.Add("Trundle");
            TopList.Add("Tryndamere");
            TopList.Add("Udyr");
            TopList.Add("Vi");
            TopList.Add("Vladimir");
            TopList.Add("Volibear");
            TopList.Add("Warwick");
            TopList.Add("Wukong");
            TopList.Add("Xin Zhao");
            TopList.Add("Yorick");
            TopList.Add("Zac");
            TopList.Add("Zed");
            TopList.Add("Vayne");
            TopList.Add("Tristana");
            SupportList.Add("Alistar");
            SupportList.Add("Janna");
            SupportList.Add("Lulu");
            SupportList.Add("Nami");
            SupportList.Add("Nunu");
            SupportList.Add("Sona");
            SupportList.Add("Soraka");
            SupportList.Add("Taric");
            SupportList.Add("Thresh");
            SupportList.Add("Zilean");
            SupportList.Add("Fiddlesticks");
            SupportList.Add("Leona");
            SupportList.Add("Blitzcrank");
            TankList.Add("Amumu");
            TankList.Add("Blitzcrank");
            TankList.Add("Cho'Gath");
            TankList.Add("Darius");
            TankList.Add("Dr. Mundo");
            TankList.Add("Galio");
            TankList.Add("Gangplank");
            TankList.Add("Garen");
            TankList.Add("Hecarim");
            TankList.Add("Irelia");
            TankList.Add("Jarvan IV");
            TankList.Add("Lee Sin");
            TankList.Add("Leona");
            TankList.Add("Malphite");
            TankList.Add("Maokai");
            TankList.Add("Nasus");
            TankList.Add("Nautilus");
            TankList.Add("Nocturne");
            TankList.Add("Nunu");
            TankList.Add("Olaf");
            TankList.Add("Rammus");
            TankList.Add("Renekton");
            TankList.Add("Sejuani");
            TankList.Add("Shen");
            TankList.Add("Shyvana");
            TankList.Add("Singed");
            TankList.Add("Trundle");
            TankList.Add("Udyr");
            TankList.Add("Vi");
            TankList.Add("Volibear");
            TankList.Add("Warwick");
            TankList.Add("Zac");
            JungleList.Add("Aatrox");
            JungleList.Add("Alistar");
            JungleList.Add("Amumu");
            JungleList.Add("Cho'Gath");
            JungleList.Add("Darius");
            JungleList.Add("Diana");
            JungleList.Add("Dr. Mundo");
            JungleList.Add("Elise");
            JungleList.Add("Evelynn");
            JungleList.Add("Ezreal");
            JungleList.Add("Fiddlesticks");
            JungleList.Add("Gangplank");
            JungleList.Add("Hecarim");
            JungleList.Add("Jarvan IV");
            JungleList.Add("Karthus");
            JungleList.Add("Kha'Zix");
            JungleList.Add("Les Sin");
            JungleList.Add("Malphite");
            JungleList.Add("Maokai");
            JungleList.Add("Master Yi");
            JungleList.Add("Nasus");
            JungleList.Add("Nautilus");
            JungleList.Add("Nocturne");
            JungleList.Add("Nunu");
            JungleList.Add("Olaf");
            JungleList.Add("Pantheon");
            JungleList.Add("Rammus");
            JungleList.Add("Rengar");
            JungleList.Add("Riven");
            JungleList.Add("Sejuani");
            JungleList.Add("Shaco");
            JungleList.Add("Shenn");
            JungleList.Add("Shyvana");
            JungleList.Add("Singed");
            JungleList.Add("Skarner");
            JungleList.Add("Trundle");
            JungleList.Add("Tryndamere");
            JungleList.Add("Twitch");
            JungleList.Add("Udyr");
            JungleList.Add("Vi");
            JungleList.Add("Volibear");
            JungleList.Add("Warwick");
            JungleList.Add("Wukong");
            JungleList.Add("Zac");
            JungleList.Add("Zed");
            APList.Add("Ahri");
            APList.Add("Akali");
            APList.Add("Amumu");
            APList.Add("Anivia");
            APList.Add("Annie");
            APList.Add("Brand");
            APList.Add("Cassiopeia");
            APList.Add("Cho'Gath");
            APList.Add("Diana");
            APList.Add("Elise");
            APList.Add("Evelynn");
            APList.Add("Ezreal");
            APList.Add("Fiddlesticks");
            APList.Add("Fizz");
            APList.Add("Galio");
            APList.Add("Gragas");
            APList.Add("Heimerdinger");
            APList.Add("Janna");
            APList.Add("Karma");
            APList.Add("Karthus");
            APList.Add("Kassadin");
            APList.Add("Katarina");
            APList.Add("Kayle");
            APList.Add("Kennen");
            APList.Add("Kog'MMaw");
            APList.Add("LeBlanc");
            APList.Add("Lissandra");
            APList.Add("Lux");
            APList.Add("Malzahar");
            APList.Add("Maokai");
            APList.Add("Mordekaiser");
            APList.Add("Morgana");
            APList.Add("Nidalee");
            APList.Add("Orianna");
            APList.Add("Rumble");
            APList.Add("Ryze");
            APList.Add("Singed");
            APList.Add("Sion");
            APList.Add("Swain");
            APList.Add("Syndra");
            APList.Add("Teemo");
            APList.Add("Tristana");
            APList.Add("Twisted Fate");
            APList.Add("Veigar");
            APList.Add("Vladimir");
            APList.Add("Xerath");
            APList.Add("Ziggs");
            APList.Add("Zilean");
            APList.Add("Zyra");
            FighterList.Add("Darius");
            FighterList.Add("Diana");
            FighterList.Add("Gangplank");
            FighterList.Add("Garen");
            FighterList.Add("Hecarim");
            FighterList.Add("Blitzcrank");
            FighterList.Add("Irelia");
            FighterList.Add("Jarvan IV");
            FighterList.Add("Jayce");
            FighterList.Add("Kha'Zix");
            FighterList.Add("Lee Sin");
            FighterList.Add("Aatrox");
            FighterList.Add("Fiora");
            FighterList.Add("Jax");
            FighterList.Add("Kayle");
            FighterList.Add("Mordekaiser");
            FighterList.Add("Nasus");
            FighterList.Add("Olaf");
            FighterList.Add("Pantheon");
            FighterList.Add("Poppy");
            FighterList.Add("Talon");
            FighterList.Add("Renekton");
            FighterList.Add("Riven");
            FighterList.Add("Rumble");
            FighterList.Add("Shyvana");
            FighterList.Add("Sion");
            FighterList.Add("Skarner");
            FighterList.Add("Trundle");
            FighterList.Add("Tryndamere");
            FighterList.Add("Udyr");
            FighterList.Add("Vi");
            FighterList.Add("Volibear");
            FighterList.Add("Warwick");
            FighterList.Add("Wukong");
            FighterList.Add("Xin Zhao");
            FighterList.Add("Yorick");
            #endregion
        }