private void ShowPage(ContainerPage page)
		{
			// get the control to show
			var toShow = (Control)_component.GetPageView(page).GuiElement;

			// hide all others
			foreach (var c in this.Controls.Cast<Control>().Where(c => c != toShow))
			{
				c.Visible = false;
			}

			// if the control has not been added to the content panel, add it now
			if (!this.Controls.Contains(toShow))
			{
				toShow.Dock = DockStyle.Fill;
				this.Controls.Add(toShow);
			}

			toShow.Visible = true;

			// HACK: for some reason the error provider symbols don't show up the first time the control is shown
			// therefore we need to force it
			if (toShow is ApplicationComponentUserControl)
			{
				(toShow as ApplicationComponentUserControl).ErrorProvider.UpdateBinding();
			}
		}
        private void ShowPage(ContainerPage page)
        {
            // get the control to show
            var toShow = (Control)_component.GetPageView(page).GuiElement;

            // hide all others
            foreach (var c in this.Controls.Cast <Control>().Where(c => c != toShow))
            {
                c.Visible = false;
            }

            // if the control has not been added to the content panel, add it now
            if (!this.Controls.Contains(toShow))
            {
                toShow.Dock = DockStyle.Fill;
                this.Controls.Add(toShow);
            }

            toShow.Visible = true;

            // HACK: for some reason the error provider symbols don't show up the first time the control is shown
            // therefore we need to force it
            if (toShow is ApplicationComponentUserControl)
            {
                (toShow as ApplicationComponentUserControl).ErrorProvider.UpdateBinding();
            }
        }
Ejemplo n.º 3
0
        public void LoadOverviewChart(string filter, string title)
        {
            HttpResponse response = HttpContext.Current.Response;

            try
            {
                Page           page  = new ContainerPage();
                ChartContainer chart = (ChartContainer)page.LoadControl("~/UserControls/ChartContainer.ascx");

                Dictionary <string, object> dic = new Dictionary <string, object>();

                dic[ChartConfigurationKeys.QUERY.ToString()]     = string.Format(Constants.GenerateDrilldownChart, filter);
                dic[ChartConfigurationKeys.HEIGHT.ToString()]    = 350;
                dic[ChartConfigurationKeys.WIDTH.ToString()]     = 250;
                dic[ChartConfigurationKeys.XVALARRAY.ToString()] = "NAME";
                dic[ChartConfigurationKeys.YVALARRAY.ToString()] = new List <string> {
                    "PCOUNT"
                };
                dic[ChartConfigurationKeys.XTITLE.ToString()]          = "Diesease";
                dic[ChartConfigurationKeys.YTITLE.ToString()]          = "Patients";
                dic[ChartConfigurationKeys.TYPE.ToString()]            = SeriesChartType.Pie;
                dic[ChartConfigurationKeys.LEGEND.ToString()]          = "Diesease";
                dic[ChartConfigurationKeys.TITLE.ToString()]           = title;
                dic[ChartConfigurationKeys.VIEWLEGEND.ToString()]      = true;
                dic[ChartConfigurationKeys.DISABLELABELS.ToString()]   = false;
                dic[ChartConfigurationKeys.PIELABELSTYLE.ToString()]   = "Outside";
                dic[ChartConfigurationKeys.NOOFCHARTSERIES.ToString()] = 1;
                dic[ChartConfigurationKeys.SERIESNAMES.ToString()]     = new List <string> {
                    "DieseasesVsPatients"
                };

                chart.ChartConfigurations = dic;

                page.Controls.Add(chart);

                StringBuilder text   = new StringBuilder();
                StringWriter  writer = new StringWriter(text);

                HtmlTextWriter htmlWriter = new HtmlTextWriter(writer);

                //page.RenderControl(htmlWriter);
                HttpContext.Current.Server.Execute(page, writer, false);
                response.Output.Write(text.ToString());
            }
            catch (Exception e)
            {
                response.Output.Write(e.Message);
            }
            finally
            {
                response.Output.Flush();
                response.Output.Close();
            }
        }
Ejemplo n.º 4
0
        private static ContainerPage CreatePage()
        {
            var page = new ContainerPage
                {
                    RenderingCompatibility = new Version(3, 5),
                    ClientIDMode = ClientIDMode.AutoID,
                };

            var scriptManager = new ScriptManager
                {
                    ID = "MyScriptManager",
                    EnableHistory = true,
                    EnableSecureHistoryState = false
                };
            AddDefaultScripts(scriptManager);
            page.AddControl(scriptManager);

            page.AddHead(new ContentPlaceHolder {ID = "HeadContent"});
            return page;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Determine which page is the top group parent page of all group pages
        /// </summary>
        /// <returns></returns>
        private PageReference GetTopGroupPageReference(string topGroupPageName)
        {
            var topGroupPageContainer = PageReference.StartPage;

            if (!string.IsNullOrEmpty(topGroupPageName))
            {
                var topGroupPageData = GetSpecifiedChildFromParent(PageReference.StartPage, topGroupPageName);
                if (topGroupPageData != null)
                {
                    topGroupPageContainer = topGroupPageData.ContentLink.ToPageReference();
                }
                else
                {
                    //if top group page hasn't been existed => need to create a page CotainerPage type
                    ContainerPage topGroupContainerPage = DataFactory.Instance.GetDefault <ContainerPage>(PageReference.StartPage);
                    topGroupContainerPage.PageName = topGroupPageName;
                    DataFactory.Instance.Save(topGroupContainerPage, EPiServer.DataAccess.SaveAction.Publish);
                    topGroupPageContainer = topGroupContainerPage.ContentLink.ToPageReference();
                }
            }

            return(topGroupPageContainer);
        }
Ejemplo n.º 6
0
        private static ContainerPage CreatePage()
        {
            var page = new ContainerPage
            {
                RenderingCompatibility = new Version(3, 5),
                ClientIDMode           = ClientIDMode.AutoID,
            };

            var scriptManager = new ScriptManager
            {
                ID                       = "MyScriptManager",
                EnableHistory            = true,
                EnableSecureHistoryState = false
            };

            AddDefaultScripts(scriptManager);
            page.AddControl(scriptManager);

            page.AddHead(new ContentPlaceHolder {
                ID = "HeadContent"
            });
            return(page);
        }
Ejemplo n.º 7
0
    public IEnumerator Start()
    {
        // wait until display has initialized
        while (!Display.IsInitialized())
        {
            yield return(null);
        }

        // output red hello world at 10,5 on layer 0
        string  menuStr   = "Menu:";
        Vector2 menuStart = new Vector2(0, 0);

        renderText(
            str: menuStr,
            x: (int)menuStart.x,
            y: (int)menuStart.y,
            fgColor: Color.red,
            clickable: true,
            hoverable: true
            );
        renderText(
            str: "?",
            x: (int)menuStart.x + menuStr.Length,
            y: (int)menuStart.y,
            fgColor: Color.yellow,
            clickable: true,
            hoverable: true
            );

        menus = new ButtonList[] {
            new ButtonList(
                new Button[] {
                new Button(
                    text: "clear",
                    mouseDown: delegate {
                    Debug.Log("clear");
                    this.renderPage = "";
                    this.clearLayer = 1;
                }
                    ),
                new Button(
                    text: "Description",
                    mouseDown: delegate {
                    Debug.Log("DescriptionPage");
                    this.renderPage = "DescriptionPage";
                    this.clearLayer = 1;
                }
                    ),
                new Button(
                    text: "Button",
                    mouseDown: delegate {
                    Debug.Log("ButtonPage");
                    this.renderPage = "ButtonPage";
                    this.clearLayer = 1;
                }
                    ),
                new Button(
                    text: "ButtonList",
                    mouseDown: delegate {
                    Debug.Log("ButtonListPage");
                    this.renderPage = "ButtonListPage";
                    this.clearLayer = 1;
                }
                    ),
                new Button(
                    text: "Player",
                    mouseDown: delegate {
                    Debug.Log("PlayerPage");
                    this.renderPage = "PlayerPage";
                    this.clearLayer = 1;
                }
                    ),
                new Button(
                    text: "Map",
                    mouseDown: delegate {
                    Debug.Log("MapPage");
                    this.renderPage = "MapPage";
                    this.clearLayer = 1;
                }
                    ),
                new Button(
                    text: "Container",
                    mouseDown: delegate {
                    Debug.Log("ContainerPage");
                    this.renderPage = "ContainerPage";
                    this.clearLayer = 1;
                }
                    )
            },
                x: 1,
                y: 1,
                layer: 0
                )
        };

        buttonPage      = new ButtonPage(x: 20, y: 1);
        buttonListPage  = new ButtonListPage(x: 20, y: 1);
        descriptionPage = new DescriptionPage(x: 20, y: 1);
        playerPage      = new PlayerPage(x: 20, y: 1);
        mapPage         = new MapPage(x: 20, y: 1);
        containerPage   = new ContainerPage(x: 20, y: 1);

        /*
         * menuButtons[0] = new Button(
         *  text: "a Room",
         *  x: 0,
         *  y: 1
         * );
         *
         * menuButtons[1] = new Button(
         *  text: "@ Walking",
         *  x: 0,
         *  y: 2
         * );
         */

        /*for (int x = 0; x < menu.Length; x++)
         * {
         *  Cell cell = Display.CellAt(0, 0 + x, 0);
         *  cell.SetContent(
         *      menu.Substring(x, 1),
         *      Color.clear,
         *      Color.red);
         * }*/

        /*
         * // add clickable cell text on layer 2
         * string clickableText = "Click->";
         * for (int x = 0; x < clickableText.Length; x++)
         * {
         *  Cell cell = Display.CellAt(2, x, 17);
         *  cell.SetContent(
         *      clickableText.Substring(x, 1),
         *      Color.clear,
         *      Color.yellow);
         * }
         */

        // add clickable cell on layer 0

        /*
         * Cell clickable = Display.CellAt(0, 0 + menu.Length, 0);
         * clickable.SetContent(
         *  "?",
         *  Color.black,
         *  Color.yellow);
         * clickable.clickAction = this;
         * clickable.hoverAction = this;
         */
        /*
         * Cell clickable2 = Display.CellAt(0, 0 + menu.Length, 1);
         * clickable2.SetContent(
         *  "#",
         *  Color.black,
         *  Color.yellow);
         * clickable2.clickAction = this;
         * clickable2.hoverAction = this;
         */
        //StartCoroutine(RandomGrid());
        //StartCoroutine(Transition());
    }
Ejemplo n.º 8
0
        public App()
        {
            InitializeComponent();

            MainPage = new ContainerPage();
        }