Mini Kabibi Habibi
Imports System.Windows.Forms
Imports DevExpress.Utils.Frames
Imports DevExpress.XtraEditors
Imports DevExpress.XtraCharts.Wizard
Imports DevExpress.XtraCharts.Demos.Modules
Imports DevExpress.DXperience.Demos
Namespace DevExpress.XtraCharts.Demos
Public Class DemosInfo
Inherits ModulesInfo
Public Overloads Shared Sub ShowModule(ByVal name As String, ByVal group As GroupControl, ByVal caption As ApplicationCaption, ByVal manager As ChartRibbonMenuManager)
Dim item As ModuleInfo = DemosInfo.GetItem(name)
Dim currentCursor As Cursor = Cursor.Current
Cursor.Current = Cursors.WaitCursor
Try
Dim oldTutorial As Control = Nothing
If Instance.CurrentModuleBase IsNot Nothing Then
If Instance.CurrentModuleBase.Name = name Then
Return
End If
oldTutorial = Instance.CurrentModuleBase.TModule
End If
Dim tutorial As TutorialControlBase = TryCast(item.TModule, TutorialControlBase)
tutorial.Bounds = group.DisplayRectangle
Instance.CurrentModuleBase = item
tutorial.Visible = False
group.Controls.Add(tutorial)
tutorial.Dock = DockStyle.Fill
Dim tc As TutorialControl = TryCast(item.TModule, TutorialControl)
If tc IsNot Nothing Then
manager.AllowExport(tc.ChartControl)
manager.ShowReservGroup1(True)
manager.ShowReservGroup2(True)
Else
manager.AllowExport(Nothing)
manager.ShowReservGroup1(False)
manager.ShowReservGroup2(False)
End If
manager.UpdateAppearanceAndPalette()
tutorial.RibbonMenuManager = manager
tutorial.TutorialName = name
tutorial.Caption = caption
tutorial.Visible = True
item.WasShown = True
If oldTutorial IsNot Nothing Then
oldTutorial.Visible = False
End If
Finally
Cursor.Current = currentCursor
End Try
RaiseModuleChanged()
End Sub
Public Shared Function SetAppearanceName(ByVal appearanceName As String) As String
If Instance.CurrentModuleBase IsNot Nothing Then
Dim chartModule As ChartDemoBase = TryCast(Instance.CurrentModuleBase.TModule, ChartDemoBase)
If chartModule IsNot Nothing Then
chartModule.AppearanceName = appearanceName
Return chartModule.PaletteName
End If
End If
Return String.Empty
End Function
Public Shared Function SetPaletteName(ByVal paletteName As String) As String
If Instance.CurrentModuleBase IsNot Nothing Then
Dim chartModule As ChartDemoBase = TryCast(Instance.CurrentModuleBase.TModule, ChartDemoBase)
If chartModule IsNot Nothing Then
chartModule.PaletteName = paletteName
Return chartModule.AppearanceName
End If
End If
Return String.Empty
End Function
Public Shared Sub RunChartWizard()
If Instance.CurrentModuleBase IsNot Nothing Then
Dim chartModule As ChartDemoBase = TryCast(Instance.CurrentModuleBase.TModule, ChartDemoBase)
If chartModule IsNot Nothing Then
Dim chartWizard As New ChartWizard(chartModule.ChartControl)
chartWizard.ShowDialog()
chartModule.UpdateControls()
End If
End If
End Sub
End Class
End Namespace