Exemple #1
0
        async Task LoadModelAsync(ModuleInfo module)
        {
            await Task.Factory.StartNew(() =>
            {
                if (!fluentDesignFormContainer1.Controls.ContainsKey(module.Name))
                {
                    TutorialControlBase control = module.TModule as TutorialControlBase;

                    if (control != null)
                    {
                        control.Dock = DockStyle.Fill;
                        control.CreateWaitDialog();
                        fluentDesignFormContainer1.Invoke(new MethodInvoker(delegate()
                        {
                            fluentDesignFormContainer1.Controls.Add(control);
                            control.BringToFront();
                        }));
                    }
                }
                else
                {
                    var control = fluentDesignFormContainer1.Controls.Find(module.Name, true);
                    if (control.Length == 1)
                    {
                        fluentDesignFormContainer1.Invoke(new MethodInvoker(delegate()
                        {
                            control[0].BringToFront();
                        }));
                    }
                }
            });
        }
        public static void ShowModule(string name, DevExpress.XtraEditors.GroupControl group, ChartAppearanceMenu chartAppearanceMenu, IDXMenuManager menuManager, DevExpress.Utils.Frames.ApplicationCaption caption)
        {
            ModuleInfo item          = ChartModulesInfo.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;
                }

                TutorialControlBase tutorialBase = item.TModule as TutorialControlBase;
                tutorialBase.Bounds        = group.DisplayRectangle;
                Instance.CurrentModuleBase = item;
                tutorialBase.Visible       = false;
                group.Controls.Add(tutorialBase);
                tutorialBase.Dock = DockStyle.Fill;

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

                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;
                if (oldTutorial != null)
                {
                    oldTutorial.Visible = false;
                }
            }
            finally
            {
                Cursor.Current = currentCursor;
            }
            RaiseModuleChanged();
        }
        public void ShowModule(string name)
        {
            this.pnlMain.Parent.SuspendLayout();
            this.pnlMain.SuspendLayout();
            this.ShowModule(name, this.pnlMain, this.defaultLookAndFeel1);
            this.SetFormParam();

            TutorialControlBase tModule = ModulesInfo.Instance.CurrentModuleBase.TModule as TutorialControlBase;

            if (tModule != null)
            {
                tModule.RunActiveDemo();
            }
        }