コード例 #1
0
        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);
        }
        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;
            }
        }
コード例 #3
0
        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);
        }