partial void ContentButtonClick(NSObject sender)
        {
            ContentButton.State    = NSCellStateValue.On;
            IndexButton.State      = NSCellStateValue.Off;
            AnnotationButton.State = NSCellStateValue.Off;

            if (TOCDataManager == null)
            {
                TOCDataManager                   = new PublicationTOCDataManager(BookID, BookTitle, this);
                TOCViewController.BookID         = BookID;
                TOCViewController.IsExpired      = IsExpired;
                TOCViewController.CurrencyDate   = CurrencyDate;
                TOCViewController.TOCDataManager = TOCDataManager;
                TOCViewController.InitializeTableView();
            }

            PageViewController.SetIndexBannerLetter(null, false);

            if (TOCDataManager.CurrentLeafNode == null)
            {
                PageViewController.ShowPageContent(null, true);
            }
            else
            {
                OpenPublicationContentAtTOCNode(BookID, TOCDataManager.CurrentLeafNode);
            }

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, true);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, false);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }
        //TocViewController
        public async Task OpenPublicationContentAtTOCNode(int bookID, TOCNode tocNode)
        {
            string htmlString = await PublicationContentUtil.Instance.GetContentFromTOC(bookID, tocNode, true);

            //string title = PublicationsDataManager.SharedInstance.CurrentPublication.Name;
            //await PdfUtil.SaveAsPdf (htmlString, title);
            NavigationMode nm;

            if (this.IsHighlighting)
            {
                nm = NavigationMode.NM_Search;
                this.IsHighlighting = false;
            }
            else
            {
                nm = NavigationMode.NM_Contents;
                TOCDataManager.ClearSearchResult();
            }

            PageViewController.AddLoadView();
            PageViewController.CurrentSearchHeader = TOCDataManager.CurrentSearchHeader;
            PageViewController.SearchPageNumber    = this.searchPageNumber;

            TOCDataManager.StartTocID = tocNode.ID;
            TOCDataManager.EndTocID   = tocNode.ID;

            PageViewController.ShowPageContent(htmlString, true, bookID, tocNode.ID.ToString(), tocNode.Title);

            GetFirstPageNumberAtTocID(tocNode.ID);

            AddNavigationPathAtBookIDandTocID(bookID, tocNode.ID, nm);
        }
        partial void AnnotationButtonClick(NSObject sender)
        {
            ContentButton.State    = NSCellStateValue.Off;
            IndexButton.State      = NSCellStateValue.Off;
            AnnotationButton.State = NSCellStateValue.On;

            PageViewController.SetIndexBannerLetter(null, false);
            PageViewController.ShowPageContent(null, false);

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, false);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, false);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, true);
        }
Exemplo n.º 4
0
        //TocViewController
        public async Task OpenPublicationContentAtTOCNode(int bookID, TOCNode tocNode)
        {
            Console.WriteLine("bookID:{0}, tocID:{1}", bookID, tocNode.ID);
//			if (TocListForBackForward.Count >= 30) {
//				TocListForBackForward.RemoveAt (0);
//			}
//
//			var dict = new Dictionary<int,TOCNode> ();
//			dict.Add (bookID, tocNode);
//
//			TocListForBackForward.Add (dict);
//			this.CurrentHistoryIndex = TocListForBackForward.Count - 1;
//			EnablePreNextButton ();

            AddNavigationPathAtBookIDandTocID(bookID, tocNode.ID);

            string htmlString = await PublicationContentUtil.Instance.GetContentFromTOC(bookID, tocNode);

            PageViewController.ShowPageContent(htmlString, true, bookID, tocNode.ID.ToString(), tocNode.Title);
        }
        public async void OpenPublicationIndexAtIndexNode(Index indexNode)
        {
            if (indexNode == null)
            {
                PageViewController.SetIndexBannerLetter(null, false);
                PageViewController.ShowPageContent(null, false);
            }
            else
            {
                if (!string.IsNullOrEmpty(indexNode.Title))
                {
                    PageViewController.SetIndexBannerLetter(indexNode.Title, true);
                }

                if (!string.IsNullOrEmpty(indexNode.FileName))
                {
                    string htmlString = await PublicationContentUtil.Instance.GetContentFromIndex(BookID, indexNode);

                    PageViewController.ShowPageContent(htmlString, true);
                }
            }
        }
        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);
        }
        async partial void IndexButtonClick(NSObject sender)
        {
            if (currentViewMode == ContentMode.CM_Index)
            {
                return;
            }

            currentViewMode        = ContentMode.CM_Index;
            ContentButton.State    = NSCellStateValue.Off;
            IndexButton.State      = NSCellStateValue.On;
            AnnotationButton.State = NSCellStateValue.Off;
            await HidePreNextButton(true);

            if (IdxDataManager.CurrentRow == 0)
            {
                IndexViewController.SelectItemByRow(1);
            }
            else
            {
                OpenPublicationIndexAtIndexNode(IdxDataManager.CurrentIndex);
            }

            BookContentView.Hidden = false;

            if (IdxDataManager.IndexNodeList == null)
            {
                PageViewController.SetIndexBannerLetter("No index files available.", true);
                string infoString = "<br>" + "<br>" + "<br>" + "<br>" + "No index files available.";
                PageViewController.ShowPageContent(infoString, true, 0, null, null);
            }

            SetSideBarViewShowByMode();

            SetButtonAttributedTitle(ContentButton, LNRConstants.TITLE_CONTENT, false);
            SetButtonAttributedTitle(IndexButton, LNRConstants.TITLE_INDEX, true);
            SetButtonAttributedTitle(AnnotationButton, LNRConstants.TITLE_ANNOTATIONS, false);
        }
        public async void OpenPublicationContentAtTOCNode(int bookID, TOCNode tocNode)
        {
            string htmlString = await PublicationContentUtil.Instance.GetContentFromTOC(bookID, tocNode);

            PageViewController.ShowPageContent(htmlString, true);
        }