예제 #1
0
        public async Task LoadBoardGameAsync()
        {
            if (objectId == null)
            {
                Debug.WriteLine("Attemted to load Board Game with no object id");
                return;
            }
            int id;

            if (int.TryParse(objectId, out id))
            {
                // Wait to set Property until after IsLoading is turned off due to
                // property change event
                BoardGame boardGame = null;
                IsLoading = true;
                try
                {
                    boardGame = (await cache.BoardGamesFromIds(id)).First();
                }
                finally
                {
                    IsLoading = false;
                }
                BoardGame = boardGame;
            }
            else
            {
                Debug.WriteLine(String.Format("Unable to parse id {0} ", objectId));
            }
        }
예제 #2
0
        internal async Task LoadPage()
        {
            int takeCount = BoardGameIds.Count() - BoardGames.Count();

            if (takeCount > 0)
            {
                IsLoading = true;
                try
                {
                    if (takeCount > loadCount)
                    {
                        takeCount = loadCount;
                    }
                    var subSet = BoardGameIds.Skip(BoardGames.Count()).Take(takeCount);
                    var count  = subSet.Count();
                    foreach (var boardGame in await cache.BoardGamesFromIds(subSet))
                    {
                        BoardGames.Add(new IndexedBoardGame(boardGame));
                    }
                }
                finally
                {
                    IsLoading = false;
                }
            }
        }
예제 #3
0
        public async Task LoadPage()
        {
            int takeCount = SearchResultIds.Count() - SearchResult.Count();

            if (takeCount > 0)
            {
                IsLoading = true;
                try
                {
                    if (takeCount > loadCount)
                    {
                        takeCount = loadCount;
                    }
                    var subSet = SearchResultIds.Skip(SearchResult.Count()).Take(takeCount);
                    var count  = subSet.Count();
                    foreach (var boardGame in await cache.BoardGamesFromIds(subSet))
                    {
                        SearchResult.Add(boardGame);
                    }
                }
                finally
                {
                    IsLoading = false;
                }
            }
        }
예제 #4
0
        public async Task LoadBoardGameAsync()
        {
            if (objectId == null)
            {
                Debug.WriteLine("Attemted to load Board Game with no object id");
                return;
            }
            int id;

            if (int.TryParse(objectId, out id))
            {
                BoardGame = (await cache.BoardGamesFromIds(id)).First();
            }
            else
            {
                Debug.WriteLine(String.Format("Unable to parse id {0} ", objectId));
            }
        }