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);
        }
        //api with IndexViewController
        public async void OpenPublicationIndexAtIndexNode(Index indexNode)
        {
            if (indexNode == null)
            {
                PageViewController.SetIndexBannerLetter(null, false);
                PageViewController.ShowPageContent(null, false, 0, null, null);
            }
            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, 0, null, null);
                    IndexViewController.RefreshSelectBackColor();
                }
            }
        }
        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);
        }
        void ReleaseDesignerOutlets()
        {
            if (AnnotationButton != null)
            {
                AnnotationButton.Dispose();
                AnnotationButton = null;
            }

            if (AnnotationView != null)
            {
                AnnotationView.Dispose();
                AnnotationView = null;
            }

            if (BackgroudView != null)
            {
                BackgroudView.Dispose();
                BackgroudView = null;
            }

            if (BookContentView != null)
            {
                BookContentView.Dispose();
                BookContentView = null;
            }

            if (ContentButton != null)
            {
                ContentButton.Dispose();
                ContentButton = null;
            }

            if (FunctionButtonView != null)
            {
                FunctionButtonView.Dispose();
                FunctionButtonView = null;
            }

            if (GotoButton != null)
            {
                GotoButton.Dispose();
                GotoButton = null;
            }

            if (IndexButton != null)
            {
                IndexButton.Dispose();
                IndexButton = null;
            }

            if (IndexCustomView != null)
            {
                IndexCustomView.Dispose();
                IndexCustomView = null;
            }

            if (IndexViewController != null)
            {
                IndexViewController.Dispose();
                IndexViewController = null;
            }

            if (LeftButton != null)
            {
                LeftButton.Dispose();
                LeftButton = null;
            }

            if (PageNumber != null)
            {
                PageNumber.Dispose();
                PageNumber = null;
            }

            if (PageViewController != null)
            {
                PageViewController.Dispose();
                PageViewController = null;
            }

            if (RightButton != null)
            {
                RightButton.Dispose();
                RightButton = null;
            }

            if (TocCustomView != null)
            {
                TocCustomView.Dispose();
                TocCustomView = null;
            }

            if (TOCViewController != null)
            {
                TOCViewController.Dispose();
                TOCViewController = null;
            }

            if (AnnotationsVC != null)
            {
                AnnotationsVC.Dispose();
                AnnotationsVC = null;
            }
        }
 public IndexTableViewDelegate(IndexViewController controller)
 {
     viewController   = controller;
     indexDataManager = viewController.IndexDataManager;
 }
Exemplo n.º 7
0
 public IndexTableViewDataSources(IndexViewController controller)
 {
     viewController   = controller;
     indexDataManager = viewController.IndexDataManager;
 }
 public void RefreshIndexViewData()
 {
     IndexViewController.RefreshOutlineViewData();
 }
        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);
        }
Exemplo n.º 10
0
        void ReleaseDesignerOutlets()
        {
            if (AnnotationButton != null)
            {
                AnnotationButton.Dispose();
                AnnotationButton = null;
            }

            if (AnnotationView != null)
            {
                AnnotationView.Dispose();
                AnnotationView = null;
            }

            if (BackgroudView != null)
            {
                BackgroudView.Dispose();
                BackgroudView = null;
            }

            if (BookContentView != null)
            {
                BookContentView.Dispose();
                BookContentView = null;
            }

            if (ContentButton != null)
            {
                ContentButton.Dispose();
                ContentButton = null;
            }

            if (FunctionButtonView != null)
            {
                FunctionButtonView.Dispose();
                FunctionButtonView = null;
            }

            if (HistoryButton != null)
            {
                HistoryButton.Dispose();
                HistoryButton = null;
            }

            if (IndexButton != null)
            {
                IndexButton.Dispose();
                IndexButton = null;
            }

            if (IndexCustomView != null)
            {
                IndexCustomView.Dispose();
                IndexCustomView = null;
            }

            if (IndexViewController != null)
            {
                IndexViewController.Dispose();
                IndexViewController = null;
            }

            if (InfoButton != null)
            {
                InfoButton.Dispose();
                InfoButton = null;
            }

            if (LeftButton != null)
            {
                LeftButton.Dispose();
                LeftButton = null;
            }

            if (PageNumber != null)
            {
                PageNumber.Dispose();
                PageNumber = null;
            }

            if (PageViewController != null)
            {
                PageViewController.Dispose();
                PageViewController = null;
            }

            if (RightButton != null)
            {
                RightButton.Dispose();
                RightButton = null;
            }

            if (SearchField != null)
            {
                SearchField.Dispose();
                SearchField = null;
            }

            if (SegmentContol != null)
            {
                SegmentContol.Dispose();
                SegmentContol = null;
            }

            if (ShareButton != null)
            {
                ShareButton.Dispose();
                ShareButton = null;
            }

            if (SplitSwithButton != null)
            {
                SplitSwithButton.Dispose();
                SplitSwithButton = null;
            }

            if (TitleTField != null)
            {
                TitleTField.Dispose();
                TitleTField = null;
            }

            if (TocCustomView != null)
            {
                TocCustomView.Dispose();
                TocCustomView = null;
            }

            if (TOCViewController != null)
            {
                TOCViewController.Dispose();
                TOCViewController = null;
            }

            if (GotoButton != null)
            {
                GotoButton.Dispose();
                GotoButton = null;
            }
        }