コード例 #1
0
        public List <FrameworkElement> GetPrintContent()
        {
            List <FrameworkElement> list = new List <FrameworkElement>();

            var part        = NavigationManager.GetQueryString("part");
            int slide       = 0;
            var slideString = NavigationManager.GetQueryString("slide");

            if (slideString != string.Empty)
            {
                slide = Convert.ToInt32(slideString);
            }
            int id       = 0;
            var idString = NavigationManager.GetQueryString("id");

            if (idString != string.Empty)
            {
                id = Convert.ToInt32(idString);
            }

            if (part == "city")
            {
                RichCityPage richPage = new RichCityPage();
                richPage.GetPages().ForEach(x => list.Add(x));
                list.RemoveAt(list.Count - 1); // 去掉最后一个
            }
            else if (part == "financial")
            {
                RichFinancialPage richPage = new RichFinancialPage();
                richPage.GetPages().ForEach(x => list.Add(x));
                list.RemoveAt(list.Count - 1); // 去掉最后一个
            }
            else if (part == "project")
            {
                RichProjectPage richPage = new RichProjectPage();
                richPage.SetProj(id);
                richPage.GetPages().ForEach(x => list.Add(x));
                list.RemoveAt(list.Count - 1); // 去掉最后一个
            }
            else if (part == "pip")
            {
                PipPage richPage = new PipPage();
                richPage.Update().ForEach(x =>
                {
                    var fes = x.Children.Cast <FrameworkElement>().ToList();
                    fes.ForEach(y =>
                    {
                        x.Children.Remove(y);
                        list.Add(y);
                    });
                });
            }
            else if (part == "summary")
            {
                SummaryPage richpage = new SummaryPage();
                richpage.Update();
                var content = richpage.LayoutRoot;
                content.Children.RemoveAt(0);
                content.Children.RemoveAt(content.Children.Count - 2);
                richpage.grid1.Children.Remove(content);
                list.Add(content);
            }
            return(list);
        }
コード例 #2
0
        public void ReadyContent()
        {
            var part        = NavigationManager.GetQueryString("part");
            int slide       = 0;
            var slideString = NavigationManager.GetQueryString("slide");

            if (slideString != string.Empty)
            {
                slide = Convert.ToInt32(slideString);
            }
            int id       = 0;
            var idString = NavigationManager.GetQueryString("id");

            if (idString != string.Empty)
            {
                id = Convert.ToInt32(idString);
            }

            if (part == "city")
            {
                RichCityPage richPage = new RichCityPage();
                this.Pager.Slides.Clear();
                richPage.GetPages().ForEach(x => this.Pager.Slides.Add(x));
                Pager.Slides.RemoveAt(Pager.Slides.Count - 1); // 去掉最后一个
                // 问卷
                QuestionPage page = new QuestionPage();
                Pager.Slides.Add(page.GetContent("city", 0));
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.City(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            else if (part == "financial")
            {
                RichFinancialPage richPage = new RichFinancialPage();
                this.Pager.Slides.Clear();
                richPage.GetPages().ForEach(x => this.Pager.Slides.Add(x));
                Pager.Slides.RemoveAt(Pager.Slides.Count - 1); // 去掉最后一个
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Financial(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            else if (part == "project")
            {
                RichProjectPage richPage = new RichProjectPage();
                richPage.SetProj(id);
                this.Pager.Slides.Clear();
                richPage.GetPages().ForEach(x => this.Pager.Slides.Add(x));
                Pager.Slides.RemoveAt(Pager.Slides.Count - 1); // 去掉最后一个
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Project(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            else if (part == "pip")
            {
                PipPage richPage = new PipPage();
                this.Pager.Slides.Clear();
                richPage.Update().ForEach(x => this.Pager.Slides.Add(x));
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Pip(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            //else if (part == "city_q")
            //{
            //    QuestionPage page = new QuestionPage();
            //    this.Pager.Slides.Clear();
            //    this.Pager.Slides.Add(page.GetContent("city", 0));
            //    this.Pager.ReadyControl(0);
            //}
            //else if (part == "project_q")
            //{
            //    QuestionPage page = new QuestionPage();
            //    this.Pager.Slides.Clear();
            //    this.Pager.Slides.Add(page.GetContent("project", id));
            //    this.Pager.ReadyControl(0);
            //}
            else if (part == "summary")
            {
                SummaryPage page = new SummaryPage();
                page.Update();
                var content = page.LayoutRoot;
                content.Children.RemoveAt(0);
                content.Children.RemoveAt(content.Children.Count - 2);
                page.grid1.Children.Remove(content);
                this.Pager.Slides.Clear();
                this.Pager.Slides.Add(content);
                this.Pager.ReadyControl(0);
            }
            else if (part == "about")
            {
                AboutPage ap = new AboutPage();
                this.Pager.Slides.Clear();
                this.Pager.Slides.Add(ap);
                this.Pager.ReadyControl(0);
            }
        }