Exemple #1
0
        private void handlePrevPage(object sender, EventArgs e)
        {
            MultiPanelPage page = this.Control as MultiPanelPage;

            if (page.Parent is MultiPanel)
            {
                MultiPanel wiz = page.Parent as MultiPanel;

                wiz.PageIndex--;
            }
        }
Exemple #2
0
        private void selectParentContainer(object sender, EventArgs e)
        {
            MultiPanelPage page = this.Control as MultiPanelPage;

            page.Parent.Select();

            /*if (page.Parent is MultiPanel)
             * {
             *  MultiPanel wiz = page.Parent as MultiPanel;
             *
             *  wiz.PageIndex--;
             * }*/
        }
Exemple #3
0
        protected internal void ActivatePage(int index)
        {
            //If the new page is invalid
            if (index < 0 || index >= vPages.Count)
            {
                return;
            }

            //Change to the new Page
            MultiPanelPage tWizPage = ((MultiPanelPage)vPages[index]);

            //Really activate the page
            ActivatePage(tWizPage);
        }
Exemple #4
0
        protected internal void ActivatePage(MultiPanelPage page)
        {
            //Deactivate the current
            if (vActivePage != null)
            {
                vActivePage.Visible = false;
            }

            //Activate the new page
            vActivePage = page;

            if (vActivePage != null)
            {
                //Ensure that this panel displays inside the MultiPanel
                vActivePage.Parent = this;
                if (this.Contains(vActivePage) == false)
                {
                    this.Container.Add(vActivePage);
                }

                //if (DesignMode && vActivePage.BackColor == SystemColors.Control)
                //    vActivePage.BackColor = Color.FromArgb(this.Parent.BackColor.ToArgb());

                //Make it fill the space
                vActivePage.Dock    = DockStyle.Fill;
                vActivePage.Visible = true;
                vActivePage.BringToFront();
                //vActivePage.FocusFirstTabIndex();
            }

            //Cause a refresh
            if (vActivePage != null)
            {
                vActivePage.Invalidate();
            }
            else
            {
                this.Invalidate();
            }

            if (PageChanged != null)
            {
                PageChanged(this, EventArgs.Empty);
            }
        }
Exemple #5
0
        private void handleAddPage(object sender, EventArgs e)
        {
            MultiPanel wiz = this.Control as MultiPanel;

            IDesignerHost           h = (IDesignerHost)GetService(typeof(IDesignerHost));
            IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            DesignerTransaction dt   = h.CreateTransaction("Add Page");
            MultiPanelPage      page = (MultiPanelPage)h.CreateComponent(typeof(MultiPanelPage));

            c.OnComponentChanging(wiz, null);

            //Add a new page to the collection
            wiz.Pages.Add(page);
            wiz.Controls.Add(page);
            wiz.ActivatePage(page);

            c.OnComponentChanged(wiz, null, null, null);
            dt.Commit();
        }
Exemple #6
0
 /// <summary>
 /// Removes the given page from the collection
 /// </summary>
 /// <param name="value">Page to remove</param>
 public void Remove(MultiPanelPage value)
 {
     //Remove the item
     List.Remove(value);
 }
Exemple #7
0
 /// <summary>
 /// Adds a new page at a particular position in the Collection
 /// </summary>
 /// <param name="index">Position</param>
 /// <param name="value">Page to be added</param>
 public void Insert(int index, MultiPanelPage value)
 {
     List.Insert(index, value);
 }
Exemple #8
0
 /// <summary>
 /// Finds the position of the page in the colleciton
 /// </summary>
 /// <param name="value">Page to find position of</param>
 /// <returns>Index of Page in collection</returns>
 public int IndexOf(MultiPanelPage value)
 {
     return(List.IndexOf(value));
 }
 /// <summary>
 /// Removes the given page from the collection
 /// </summary>
 /// <param name="value">Page to remove</param>
 public void Remove( MultiPanelPage value )
 {
     //Remove the item
     List.Remove( value );
 }
Exemple #10
0
 /// <summary>
 /// Adds a new page at a particular position in the Collection
 /// </summary>
 /// <param name="index">Position</param>
 /// <param name="value">Page to be added</param>
 public void Insert( int index, MultiPanelPage value )
 {
     List.Insert(index, value );
 }
Exemple #11
0
 /// <summary>
 /// Finds the position of the page in the colleciton
 /// </summary>
 /// <param name="value">Page to find position of</param>
 /// <returns>Index of Page in collection</returns>
 public int IndexOf( MultiPanelPage value )
 {
     return( List.IndexOf( value ) );
 }
Exemple #12
0
 /// <summary>
 /// Adds an array of pages into the collection. Used by the Studio Designer generated coed
 /// </summary>
 /// <param name="pages">Array of pages to add</param>
 public void AddRange(MultiPanelPage[] pages)
 {
     // Use external to validate and add each entry
     foreach(MultiPanelPage page in pages)
     {
         this.Add(page);
     }
 }
Exemple #13
0
 /// <summary>
 /// Adds a MultiPanelPage into the Collection
 /// </summary>
 /// <param name="value">The page to add</param>
 /// <returns></returns>
 public int Add(MultiPanelPage value )
 {
     int result = List.Add( value );
     return result;
 }
Exemple #14
0
        protected internal void ActivatePage(MultiPanelPage page)
        {
            //Deactivate the current
            if (vActivePage != null)
            {
                vActivePage.Visible = false;
            }

            //Activate the new page
            vActivePage = page;

            if (vActivePage != null)
            {
                //Ensure that this panel displays inside the MultiPanel
                vActivePage.Parent = this;
                if (this.Contains(vActivePage) == false)
                {
                    this.Container.Add(vActivePage);
                }

                //if (DesignMode && vActivePage.BackColor == SystemColors.Control)
                //    vActivePage.BackColor = Color.FromArgb(this.Parent.BackColor.ToArgb());

                //Make it fill the space
                vActivePage.Dock = DockStyle.Fill;
                vActivePage.Visible = true;
                vActivePage.BringToFront();
                //vActivePage.FocusFirstTabIndex();
            }

            //Cause a refresh
            if (vActivePage != null)
                vActivePage.Invalidate();
            else
                this.Invalidate();

            if (PageChanged != null)
                PageChanged(this, EventArgs.Empty);
        }
Exemple #15
0
 /// <summary>
 /// Detects if a given Page is in the Collection
 /// </summary>
 /// <param name="value">Page to find</param>
 /// <returns></returns>
 public bool Contains(MultiPanelPage value)
 {
     // If value is not of type Int16, this will return false.
     return(List.Contains(value));
 }
Exemple #16
0
        /// <summary>
        /// Adds a MultiPanelPage into the Collection
        /// </summary>
        /// <param name="value">The page to add</param>
        /// <returns></returns>
        public int Add(MultiPanelPage value)
        {
            int result = List.Add(value);

            return(result);
        }
Exemple #17
0
 /// <summary>
 /// Detects if a given Page is in the Collection
 /// </summary>
 /// <param name="value">Page to find</param>
 /// <returns></returns>
 public bool Contains( MultiPanelPage value )
 {
     // If value is not of type Int16, this will return false.
     return( List.Contains( value ) );
 }