public async Task RefreshContentViewAtBookIDandTocNode(int tocID, bool isHighlight) { Publication BookInfo = PublicationsDataManager.SharedInstance.CurrentPublication; BookTitle = BookInfo.Name; bool isSameBook = BookID == BookInfo.BookId ? true : false; BookID = BookInfo.BookId; IsExpired = BookInfo.DaysRemaining < 0 ? true : false; if (BookInfo.CurrencyDate == null) { return; } this.isFullContentPage = false; this.IsHighlighting = isHighlight; this.searchPageNumber = null; PageNumber.StringValue = ""; //initalize content view PageViewController.InitalizeStatus(); string currencyDate = "Currency Date " + BookInfo.CurrencyDate.Value.ToString("dd MMM yyyy"); CurrencyDate = currencyDate; //initialize toc view TOCViewController.BookID = BookID; TOCViewController.IsExpired = IsExpired; TOCViewController.CurrencyDate = CurrencyDate; TOCViewController.InitializeTableView(isSameBook); TOCDataManager.InitializeTOCDataByBookID(BookID, tocID); TOCViewController.TOCDataManager = TOCDataManager; await TOCDataManager.GetPublicationTocFromDB(); SwitchToContentView(); //initialize index view IndexViewController.BookID = BookID; IdxDataManager.BookID = BookID; IdxDataManager.CurrentRow = 0; IdxDataManager.CurrentIndex = null; await IndexViewController.IndexDataManager.GetIndexDataFromDB(); IndexViewController.InitializeOutlineView(); AnnotationsVC.ReloadAnnotationDataWithBookID(BookID); }
async partial void IndexButtonClick(NSObject sender) { ContentButton.State = NSCellStateValue.Off; IndexButton.State = NSCellStateValue.On; AnnotationButton.State = NSCellStateValue.Off; HidePreNextButton(true); if (IdxDataManager == null) { IdxDataManager = new IndexDataManager(BookID, BookTitle, this); IndexViewController.BookID = BookID; IndexViewController.IndexDataManager = IdxDataManager; await IndexViewController.IndexDataManager.GetIndexDataFromDB(); IndexViewController.InitializeOutlineView(); } else { if (IdxDataManager.CurrentIndex != null) { OpenPublicationIndexAtIndexNode(IdxDataManager.CurrentIndex); PageViewController.SetIndexBannerLetter(null, true); } } PageViewController.View.Hidden = false; if (IdxDataManager.IndexNodeList == null) { PageViewController.SetIndexBannerLetter("No index files available.", true); PageViewController.ShowPageContent("No index files available.", true); } SetSideBarViewShowByMode(); SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, false); SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, true); SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false); }