Example #1
0
        public void BindPage(Page page)
        {
            laTitle.Text = "";
            laText.Text = "";
            laRM.Text = "";

            lbItems.Items.Clear();
            lvActions.Items.Clear();

            if (page != null)
            {
                laTitle.Text = page.Title;

                laText.Text = page.Text;

                laRM.Text = "rendermode=" + page.RenderMode + ", icon=" + page.Icon;

                for (int j = 0; j < page.MenuItems.Count; j++)
                {
                    lbItems.Items.Add(page.MenuItems[j]);
                }

                for (int j = 0; j < page.Actions.Count; j++)
                {
                    // lbActions.Items.Add(page.Actions[j]);

                    ListViewItem itm = new ListViewItem();
                    itm.Tag = page.Actions[j];
                    itm.Text = page.Actions[j].Text;
                    lvActions.Items.Add(itm);
                }
            }
        }
Example #2
0
        void BeginLoadPage(string path)
        {
            laTitle.Text = "Loading...";
            laText.Text = "Loading path: " + path;
            lbItems.Items.Clear();

            Application.DoEvents();

            string url = tbHost.Text;
            if (url.EndsWith("/"))
                url = url.Substring(0, url.Length - 1);
            url += path;

            Page page = null;
            try
            {
                WebClient wc = new WebClient();
                string respo = wc.DownloadString(url);

                page = new Page();
                page.ParseXML(respo);
            }
            catch (Exception z)
            {
                MessageBox.Show(z.ToString());
            }

            if (page != null)
            {
                RandomColorPage rcp = new RandomColorPage();
                rcp.CreateControl();
                rcp.BindPage(page);
                if (goingforward)
                    ucAnimator.BeginAnimateNext(rcp);
                else
                    ucAnimator.BeginAnimateBack(rcp);
            }
            else
            {
                if (goingforward)
                    ucAnimator.BeginAnimateNext(null);
                else
                    ucAnimator.BeginAnimateBack(null);
            }
            // BindPage(page);
        }