Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Page"/> class.
        /// </summary>
        /// <param name="factory">The factory.</param>
        /// <param name="host">The host.</param>
        /// <param name="page">The page.</param>
        public Page(Factory factory, IPageHost host, PagesPage page)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(factory.ToString());
            }

            if (host == null)
            {
                throw new ArgumentException(host.ToString());
            }

            if (page == null)
            {
                throw new ArgumentException(page.ToString());
            }

            this.host                   = host;
            this.pageId                 = page.Id;
            this.nextPageDelegateId     = page.NextPage.delegateId;
            this.nextPageArgument       = page.NextPage.Value;
            this.previousPageDelegateId = page.PreviousPage.delegateId;
            this.previousPageArgument   = page.PreviousPage.Value;
            this.helpGuid               = new Guid(page.HelpPage.Value);

            Type controlType = System.Reflection.Assembly.GetCallingAssembly().GetType(page.Implementation);

            this.pageUI = factory.CreatePage(this, controlType);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets the page.
        /// </summary>
        /// <param name="page">The page.</param>
        public void SetPage(IPageUI page)
        {
            Control control = page as Control;

            if (control != null)
            {
                this.border.Child                = control;
                this.border.Background           = null;
                control.Background               = null;
                this.pageLabel.Text              = page.Title;
                this.setupPhaseProgressBar.Value = page.ProgressPhase;
            }
        }