Esempio n. 1
0
        public static async Task <BookContainerViewModel> GetFromBookShelfStorage(BookShelfStorage.BookContainer storage, BookShelfViewModel Shelf, BookContainerViewModel Parent = null)
        {
            BookContainerViewModel result = new BookContainerViewModel(storage.Title, Shelf, Parent);

            foreach (var item in storage.Folders)
            {
                result.Add(await GetFromBookShelfStorage(item as BookShelfStorage.BookContainer, Shelf, result));
            }
            foreach (var item in storage.Files)
            {
                var temp = await BookViewModel.GetFromBookShelfStorage(item as BookShelfStorage.BookContainer.BookShelfBook, result);

                if (temp != null && temp.BookSize > 0)
                {
                    result.Add(temp);
                }
            }
            return(result);
        }
Esempio n. 2
0
        public static async Task <BookViewModel> GetFromBookShelfStorage(BookShelfStorage.BookContainer.BookShelfBook storage, BookContainerViewModel parent)
        {
            var reg1 = SettingStorage.GetValue("BookNameTrim") as System.Text.RegularExpressions.Regex;

            if (!await storage.Access.IsAccessible())
            {
                return(null);
            }
            var result = new BookViewModel(storage.ID, storage.Size, storage.Access, parent)
            {
                Title = reg1 == null ? storage.Title : reg1.Replace(storage.Title, "")
            };
            await result.GetFromBookInfoStorageAsync();

            return(result);
        }
Esempio n. 3
0
 public BookViewModel(string ID, int BookSize, BookShelfStorage.BookAccessInfo accessInfo, BookContainerViewModel Parent)
 {
     this.ID         = ID;
     this.BookSize   = BookSize;
     this.AccessInfo = accessInfo;
     this.Parent     = Parent;
 }
Esempio n. 4
0
 public BookContainerViewModel(string Title, BookShelfViewModel Shelf, BookContainerViewModel Parent = null)
 {
     this.Title     = Title;
     this.Parent    = Parent;
     this.BookShelf = Shelf;
 }