private void GetInstance() { if (_instance == null) { _instance = this; } }
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 static DevExpress.Tutorials.ModuleBase ShowModule(string name, DevExpress.XtraEditors.GroupControl group) { ModuleInfo item = TutorialsInfo.GetItem(name); Cursor currentCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; group.Parent.SuspendLayout(); group.SuspendLayout(); try { Control oldTutorial = null; if (Instance.CurrentModuleBase != null) { oldTutorial = Instance.CurrentModuleBase.TModule; } TutorialControl tutorial = item.TModule as TutorialControl; tutorial.Bounds = group.DisplayRectangle; Instance.CurrentModuleBase = item; tutorial.Visible = false; group.Controls.Add(tutorial); tutorial.Dock = DockStyle.Fill; tutorial.Visible = true; if (oldTutorial != null) { oldTutorial.Visible = false; } } finally { group.ResumeLayout(true); group.Parent.ResumeLayout(true); Cursor.Current = currentCursor; } RaiseModuleChanged(); DevExpress.Tutorials.ModuleBase module = Instance.CurrentModuleBase.TModule as DevExpress.Tutorials.ModuleBase; if (module != null) { module.TutorialInfo.Description = Instance.CurrentModuleBase.Description; module.TutorialInfo.TutorialName = Instance.CurrentModuleBase.Name; module.TutorialInfo.WhatsThisCodeFile = Instance.CurrentModuleBase.CodeFile; module.TutorialInfo.WhatsThisXMLFile = Instance.CurrentModuleBase.XMLFile; string xmlFile = DevExpress.Utils.FilesHelper.FindingFileName(Application.StartupPath, module.TutorialInfo.WhatsThisXMLFile, false); string codeFile = DevExpress.Utils.FilesHelper.FindingFileName(Application.StartupPath, module.TutorialInfo.WhatsThisCodeFile, false); if (xmlFile == "") { module.TutorialInfo.WhatsThisXMLFile = languageDir + module.TutorialInfo.WhatsThisXMLFile; } if (codeFile == "") { module.TutorialInfo.WhatsThisCodeFile = languageDir + module.TutorialInfo.WhatsThisCodeFile; } } return(module); }
void Awake() { instance = this; }
void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { TutorialControl.SetTabIndex(RibbonControl.TabControl.SelectedIndex); }