public ReadFB2Page()
        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);

            BackGroundGrid.Background = new SolidColorBrush(ProgramState.CurrentState.TextStyle.SimpleTextStyle.BackgroundColor);

            if (NavigationCache.Book != null)
            {
                text.Clear();

                text.AddRange(NavigationCache.Book.Text);

                                  
                currentBookInHistory = (Book)ProgramState.CurrentState.History.Files.Find(x => x.Type == FileType.Book && ((Book)x.DocumentFile).Title == NavigationCache.Book.Title).DocumentFile;

                if (NavigationCache.Book.NavigationHistory == null || NavigationCache.Book.NavigationHistory.Count == 0)
                {
                    NavigationCache.Book.NavigationHistory = new List<TextPosition>();//new Stack<TextPosition>();
                    navigationHistory.Push(TextPosition.StartPosition);
                }
                else
                { 
                    navigationHistory = new Stack<TextPosition>(NavigationCache.Book.NavigationHistory); 
                }
            }
            bookTitle.Text = NavigationCache.Book.Title;
            
        }
示例#2
0
        public Book ToBook(Book bk)
        {
            Book thisBook = new Book(bk.BookTitle, bk.Annotation, bk.BinaryItems, bk.Authors, bk.Text, bk.LogoBin);
            thisBook.Title = this.title;
            thisBook.Downloaded_title = this.Downloaded_title;
            thisBook.SearchIcon = this.searchIcon;
            thisBook.DownloadIcon = this.downloadIcon;
            thisBook.date = this.date;
            thisBook.Ext = this.Ext;
            thisBook.FType = this.FType;
            thisBook.Id = this.Id;
            thisBook.LocalPath = this.LocalPath;
            thisBook.NavigationHistory = bk.NavigationHistory;
            thisBook.Owner_id = this.Owner_id;
            thisBook.PreviewIcon = this.PreviewIcon;
            thisBook.Photo_130 = this.Photo_130;
            thisBook.Size = this.Size;
            thisBook.Type = this.Type;
            thisBook.Url = this.Url;
            thisBook.UserExperience = bk.UserExperience;

            return thisBook;
        }