Example #1
0
        void ChangePage( Page page )
        {
            if( activePage == page )
                return;

            //hide old page
            if( activePage != null )
            {
                if( activePage.PageControl != null )
                    activePage.PageControl.Visible = false;
            }

            activePage = page;

            //load .gui file
            if( activePage.PageControl == null )
            {
                string path = Path.Combine( "Gui\\EngineProfiler", activePage.FileName );
                Control control = ControlDeclarationManager.Instance.CreateControl( path );
                activePage.PageControl = control;
                pageAreaControl.Controls.Add( control );
                activePage.OnInit();
            }

            //show page
            if( activePage.PageControl != null )
                activePage.PageControl.Visible = true;
        }
		void ChangePage( Page page )
		{
			if( activePage == page )
				return;

			//hide old page
			if( activePage != null )
			{
				if( activePage.PageControl != null )
					activePage.PageControl.Visible = false;
			}

			activePage = page;

			//load .gui file
			if( activePage.PageControl == null )
			{
				string path = Path.Combine( "GUI\\ProfilingTool", activePage.FileName );
				Control control = ControlDeclarationManager.Instance.CreateControl( path );
				activePage.PageControl = control;
				pageAreaControl.Controls.Add( control );
				activePage.OnInit();
			}

			//show page
			if( activePage.PageControl != null )
				activePage.PageControl.Visible = true;

			window.Controls[ "PageNumber" ].Text = string.Format( "{0}/{1}",
				pageSelectionComboBox.SelectedIndex + 1, pageSelectionComboBox.Items.Count );

			lastPageSelectionIndex = pageSelectionComboBox.SelectedIndex;
		}