예제 #1
0
        public static void ShowModule(string name, DevExpress.XtraEditors.GroupControl groupControl, IDXMenuManager menuManager, DevExpress.Utils.Frames.ApplicationCaption caption)
        {
            ModuleInfo item          = DemosInfo.GetItem(name);
            Cursor     currentCursor = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                Control oldTutorial = null;
                if (Instance.CurrentModuleBase != null)
                {
                    if (Instance.CurrentModuleBase.Name == name)
                    {
                        return;
                    }
                    oldTutorial = Instance.CurrentModuleBase.TModule;
                }

                TutorialControl tutorial = item.TModule as TutorialControl;
                tutorial.Bounds            = groupControl.DisplayRectangle;
                Instance.CurrentModuleBase = item;
                tutorial.Visible           = false;
                groupControl.Controls.Add(tutorial);
                tutorial.Dock = DockStyle.Fill;

                //-----Set----
                //   tutorial.DemoMainMenu = menu;
                tutorial.TutorialName = name;
                tutorial.Caption      = caption;
                tutorial.MenuManager  = menuManager;
                //------------

                tutorial.Visible = true;
                item.WasShown    = true;
                //    menu.SchedulerControl = tutorial.PrintingSchedulerControl;
                //  menu.SchedulerReport = tutorial as IDemoSchedulerReport;

                if (oldTutorial != null)
                {
                    ((TutorialControl)oldTutorial).DemoMainMenu = null;
                    oldTutorial.Visible = false;
                }
            }
            finally
            {
                Cursor.Current = currentCursor;
            }
            RaiseModuleChanged();
        }
예제 #2
0
        public static void ShowModule(string name, DevExpress.XtraEditors.PanelControl panel, ChartAppearanceMenu chartAppearanceMenu, IDXMenuManager menuManager, DevExpress.Utils.Frames.ApplicationCaption caption)
        {
            ModuleInfo item          = ChartModulesInfo.GetItem(name);
            Cursor     currentCursor = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                TutorialControlBase tutorialBase = item.TModule as TutorialControlBase;
                tutorialBase.Bounds        = panel.DisplayRectangle;
                Instance.CurrentModuleBase = item;
                tutorialBase.Visible       = false;
                panel.Controls.Add(tutorialBase);
                tutorialBase.Dock = DockStyle.Fill;

                //-----Init----
                //-----Set----
                tutorialBase.TutorialName = name;

                TutorialControl tutorial = tutorialBase as TutorialControl;
                if (tutorial != null)
                {
                    tutorial.MenuManager = menuManager;
                }

                ChartModuleBase chartDemo = tutorialBase as ChartModuleBase;

                chartAppearanceMenu.UpdateAppearanceAndPalette();

                bool wizardAndPrintAndAppearancesMenuEnabled = chartDemo != null;
                chartAppearanceMenu.EnableWizardAndPrintAndAppearancesMenu(wizardAndPrintAndAppearancesMenuEnabled);
                //------------

                tutorialBase.Visible = true;
                item.WasShown        = true;
            }
            finally
            {
                Cursor.Current = currentCursor;
            }
            RaiseModuleChanged();
        }