Пример #1
0
        protected override object DoWork(LoadPageCommandArgs value)
        {
            // load the page
            ThreadPageMetadata page = value.LoadPage(value.State);

            if (page == null)
            {
                throw new Exception("There was an error loading the requested page.");
            }

            else
            {
                this._pageCache.AddPage(page);
            }

            UpdateStatus("Rendering...");

            ThreadPageDataObject dataObject = new ThreadPageDataObject(page);

            this._currentThread          = MetadataExtensions.FromPageMetadata(page);
            this._ratingCommand.ThreadId = page.ThreadID;
            this._rating            = 0;
            this._currentThreadPage = dataObject;

            if (TotalPages != page.LastPage)
            {
                this._items          = new ThreadPageSlideViewList(page.LastPage);
                SynchronizeSlideView = true;
            }

            return(dataObject);
        }
Пример #2
0
        private bool PopulateForDesignTool()
        {
            if (System.ComponentModel.DesignerProperties.IsInDesignTool)
            {
                this.CurrentThread = new ThreadMetadata()
                {
                    ThreadID = "-1",
                    Title    = "Sample thread title that is really really long for some reason!"
                };

                this.CurrentThreadPage = ThreadPageDataObject.CreateSampleObject();
                this.CurrentPage       = this.CurrentThreadPage.PageNumber;
                this.TotalPages        = this.CurrentThreadPage.Data.LastPage;
                this.Status            = "Loading...";
                this.IsRunning         = true;
                this.Items             = new ThreadPageSlideViewList(this.TotalPages);
                return(true);
            }

            return(false);
        }