예제 #1
0
        private static async Task <IList <BlogGroup> > LoadCachedGroups()
        {
            var retVal = new List <BlogGroup>();

            foreach (var item in await StorageUtility.ListItems(GROUP_FOLDER))
            {
                try
                {
                    var group = await StorageUtility.RestoreItem <BlogGroup>(GROUP_FOLDER, item);

                    retVal.Add(group);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.ToString());
                }
            }
            return(retVal);
        }
예제 #2
0
        private static async Task <IList <BlogItem> > LoadCachedItems(BlogGroup group)
        {
            var retVal = new List <BlogItem>();

            var groupFolder = group.Id.GetHashCode().ToString();

            foreach (var item in await StorageUtility.ListItems(groupFolder))
            {
                try
                {
                    var post = await StorageUtility.RestoreItem <BlogItem>(groupFolder, item);

                    post.Group = group;
                    retVal.Add(post);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.ToString());
                }
            }

            return(retVal);
        }