Ejemplo n.º 1
0
        //インフィニットスクロール
        public void NextPage()
        {
            if (IsEnd)
            {
                return;
            }
            IsActive     = true;
            Owner.Status = "お気に入りコミュニティを取得中";
            Task.Run(() => {
                var users = FavoriteInstance.GetFavoriteCommunity();
                if (users == null)
                {
                    IsEnd        = true;
                    IsActive     = false;
                    Owner.Status = "";
                    return;
                }

                foreach (var entry in users)
                {
                    CommunityList.Add(entry);
                }
                IsActive     = false;
                Owner.Status = "";
            });
        }
Ejemplo n.º 2
0
        public override Task <CommunityList> GetAllCommunities(Empty e, ServerCallContext context)
        {
            CommunityList communityList = new CommunityList();
            var           q             = from x in db.Communities
                                          orderby x.Id ascending
                                          select x;

            foreach (var community in q)
            {
                communityList.Communities.Add(community);
            }

            return(Task.FromResult(communityList));
        }
Ejemplo n.º 3
0
        public async void GetPage()
        {
            Owner.Status = "フォローコミュニティを取得中";
            var list = await FollowInstance.GetFollowedCommunityAsync(CurrentPage);

            if (list == null)
            {
                return;
            }

            CommunityList.Clear();

            foreach (var entry in list)
            {
                CommunityList.Add(new FollowCommunityEntryViewModel(entry));
            }
            IsActive     = false;
            Owner.Status = "";
        }