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);
        }
 private void HighlightLeafTocNode(TOCNode currentToc)
 {
     TOCDataManager.GetTOCNodeListByCurrentLeafNode(currentToc);
     TOCDataManager.SetHighlightTOCIndexByTocID(currentToc.ID);
     TOCViewController.RefreshTableViewData();
     TOCViewController.ScrollCurrentLeafNodeToVisible();
 }
        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);
        }
        //for the same title
        public void HandleHistoryNotification(NSNotification notification)
        {
            var tocID = Int32.Parse(notification.Object.ToString());

            TOCNode rootTocNode    = TOCDataManager.RootNodeList[0].ParentNode;
            TOCNode currentTocNode = PublicationContentUtil.Instance.GetTOCByTOCId(tocID, rootTocNode);

            if (currentTocNode != null)
            {
                TOCDataManager.GetTOCNodeListByCurrentLeafNode(currentTocNode);
                TOCDataManager.CurrentLeafNode = currentTocNode;
                TOCViewController.RefreshTableViewData();
                TOCViewController.SelectTOCRectByTocID(currentTocNode.ID);
            }
        }
        public void HandleHistoryNotification(NSNotification notification)
        {
            var tocID = Int32.Parse(notification.Object.ToString());
            //Console.WriteLine ("nodeID:{0}",nodeID);
            TOCNode rootTocNode    = TOCDataManager.RootNodeList[0].ParentNode;
            TOCNode currentTocNode = PublicationContentUtil.Instance.GetTOCByTOCId(tocID, rootTocNode);

            if (currentTocNode != null)
            {
                OpenPublicationContentAtTOCNode(BookID, currentTocNode);
                TOCDataManager.GetTOCNodeListByCurrentLeafNode(currentTocNode);
                TOCDataManager.CurrentLeafNode = currentTocNode;
                TOCViewController.RefreshTableViewData();
                TOCViewController.HighlightTOCRectByTocNode(currentTocNode.TocID);
            }
        }
        public void RefreshTocNodeByCurrentTocID(int tocID)
        {
            TOCNode currentToc = TOCDataManager.CurrentLeafNode;

            if (currentToc != null && currentToc.ID == tocID)
            {
                return;
            }
            //Console.WriteLine ("tocID:{0} currentID:{1}",tocID,currentToc.ID);
            bool isScrollBottom = (tocID > currentToc.ID) ? true : false;

            if (TOCDataManager.GetTOCNodeListByCurrentLeafNodeID(tocID, isScrollBottom))
            {
                TOCDataManager.SetHighlightTOCIndexByTocID(tocID);
                TOCViewController.RefreshTableViewData();
                TOCViewController.ScrollCurrentLeafNodeToVisible();
            }
        }
 public void SelectTOCRectByTocID(int tocID)
 {
     TOCViewController.SelectTOCRectByTocID(tocID);
 }
 public void RefreshTOCViewData()
 {
     PageViewController.AddLoadView();
     TOCViewController.RefreshTableViewData();
 }
        public async Task InitializeContentPage(int tocID)
        {
            this.IsInitialize = true;

            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    = false;
            this.searchPageNumber  = null;
            PageNumber.StringValue = "";

            //initalize content view
            PageViewController.InitalizeStatus();

            if (tocID == -1)
            {
                if (TocListForBackForward != null)
                {
                    TocListForBackForward.Clear();
                }
                this.CurrentHistoryIndex   = 0;
                this.IsEnableAddNavigation = false;

                NavigationManager.Instance.Clear();
                EnablePreNextButton();
            }

            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);

            if (TOCDataManager == null)
            {
                TOCDataManager = new PublicationTOCDataManager(BookID, BookTitle, this);
            }
            TOCDataManager.InitializeTOCDataByBookID(BookID, tocID);
            TOCViewController.TOCDataManager = TOCDataManager;
            await TOCDataManager.GetPublicationTocFromDB();

            ContentButtonClick(ContentButton);

            //initialize index view

            if (IdxDataManager == null)
            {
                IdxDataManager = new IndexDataManager(BookID, BookTitle, this);
                IndexViewController.IndexDataManager = IdxDataManager;
            }

            IndexViewController.BookID  = BookID;
            IdxDataManager.BookID       = BookID;
            IdxDataManager.CurrentRow   = 0;
            IdxDataManager.CurrentIndex = null;
            await IndexViewController.IndexDataManager.GetIndexDataFromDB();

            IndexViewController.InitializeOutlineView();

            this.IsInitialize = false;

            AnnotationsVC.ReloadAnnotationDataWithBookID(BookID);
        }
 public void RefreshTOCViewData()
 {
     TOCViewController.RefreshTableViewData();
 }