Mini Kabibi Habibi
Imports Microsoft.VisualBasic
Imports System
Imports System.Reflection
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.DXperience.Demos
Imports DevExpress.XtraBars
Namespace DevExpress.XtraNavBar.Demos
Public Class TutorialsInfo
Inherits DevExpress.DXperience.Demos.ModulesInfo
Private Const languageDir As String = "VB\"
Shared Sub SetBarManager(ByVal ctrl As Control, ByVal manager As BarManager)
For Each element As Control In ctrl.Controls
Dim nc As NavBarControl = TryCast(element, NavBarControl)
If Not nc Is Nothing Then nc.MenuManager = manager
SetBarManager(element, manager)
Next
End Sub
Public Overloads Shared Function ShowModule(ByVal name As String, ByVal groupControl As DevExpress.XtraEditors.GroupControl, ByVal menu As DevExpress.DXperience.Demos.LookAndFeelMenu, ByVal lookAndFeel As DevExpress.LookAndFeel.DefaultLookAndFeel) As DevExpress.Tutorials.ModuleBase
Dim item As ModuleInfo = TutorialsInfo.GetItem(name)
Dim currentCursor As Cursor = Cursor.Current
Cursor.Current = Cursors.WaitCursor
groupControl.Parent.SuspendLayout()
groupControl.SuspendLayout()
Try
Dim oldTutorial As Control = Nothing
If Not Instance.CurrentModuleBase Is Nothing Then
oldTutorial = Instance.CurrentModuleBase.TModule
End If
Dim tutorial As TutorialControl = TryCast(item.TModule, TutorialControl)
tutorial.Bounds = groupControl.DisplayRectangle
Instance.CurrentModuleBase = item
tutorial.Visible = False
groupControl.Controls.Add(tutorial)
tutorial.Dock = DockStyle.Fill
If tutorial.ShowLookAndFeel Then
menu.InitLookAndFeelMenu(lookAndFeel)
Else
menu.InitLookAndFeelMenu(Nothing)
End If
SetBarManager(tutorial, menu.MainMenu.Manager)
tutorial.Visible = True
If Not oldTutorial Is Nothing Then
oldTutorial.Visible = False
End If
Finally
groupControl.ResumeLayout(True)
groupControl.Parent.ResumeLayout(True)
Cursor.Current = currentCursor
End Try
RaiseModuleChanged()
Dim [module] As DevExpress.Tutorials.ModuleBase = TryCast(Instance.CurrentModuleBase.TModule, DevExpress.Tutorials.ModuleBase)
If Not [module] Is Nothing Then
[module].TutorialInfo.Description = Instance.CurrentModuleBase.Description
[module].TutorialInfo.TutorialName = Instance.CurrentModuleBase.Name
[module].TutorialInfo.WhatsThisCodeFile = Instance.CurrentModuleBase.CodeFile
[module].TutorialInfo.WhatsThisXMLFile = Instance.CurrentModuleBase.XMLFile
Dim xmlFile As String = DevExpress.Utils.FilesHelper.FindingFileName(Application.StartupPath, [module].TutorialInfo.WhatsThisXMLFile, False)
Dim codeFile As String = DevExpress.Utils.FilesHelper.FindingFileName(Application.StartupPath, [module].TutorialInfo.WhatsThisCodeFile, False)
If xmlFile = "" Then
[module].TutorialInfo.WhatsThisXMLFile = languageDir & [module].TutorialInfo.WhatsThisXMLFile
End If
If codeFile = "" Then
[module].TutorialInfo.WhatsThisCodeFile = languageDir & [module].TutorialInfo.WhatsThisCodeFile
End If
End If
Return [module]
End Function
End Class
Friend Class RegisterTutorials
Friend Shared NewFeaturesString As String = "DevExpress XtraNavBar " & AssemblyInfo.MarketingVersion
Public Shared Sub Register()
TutorialsInfo.Add(RegisterTutorials.NewFeaturesString, "DevExpress.XtraNavBar.Demos.About")
TutorialsInfo.Add("Add Groups", "DevExpress.XtraNavBar.Demos.AddGroups", "This example demonstrates how to add/delete the navbar's groups.", Nothing, "NavBarMainDemo\AddGroups\AddGroups.vb", "Data\Tutorials\XtraNavBar\AddGroups.xml")
TutorialsInfo.Add("Add Item Links", "DevExpress.XtraNavBar.Demos.AddItemLinks", "This example demonstrates how to add/delete Items and ItemLinks in navbar control groups.", Nothing, "NavBarMainDemo\AddItemLinks\AddItemLinks.vb", "Data\Tutorials\XtraNavBar\AddItemLinks.xml")
TutorialsInfo.Add("Group Container", "DevExpress.XtraNavBar.Demos.GroupContainer", "Setting a group's GroupStyle property to ControlContainer automatically creates a container control within the group's client area. This enables you to fill the group with any Windows Forms controls just by dragging them onto the group and managing their layout in the same manner as on any other container control.", Nothing, "NavBarMainDemo\GroupContainer\GroupContainer.vb", "")
TutorialsInfo.Add("Group Styles", "DevExpress.XtraNavBar.Demos.GroupStyles", "This example displays all possible representation styles that can be applied to links in navbar control groups.", Nothing, "NavBarMainDemo\GroupStyles\GroupStyles.vb", "Data\Tutorials\XtraNavBar\GroupStyles.xml")
TutorialsInfo.Add("Hit Info", "DevExpress.XtraNavBar.Demos.HitInfo", "This example demonstrates how to obtain information on a navbar control element based on its coordinate.", Nothing, "NavBarMainDemo\HitInfo\HitInfo.vb", "")
TutorialsInfo.Add("NavBar Hints", "DevExpress.XtraNavBar.Demos.NavBarHints", "This example demonstrates how to implement hints into the NavBar control.", Nothing, "NavBarMainDemo\NavBarHints\NavBarHints.vb", "Data\Tutorials\XtraNavBar\NavBarHints.xml")
TutorialsInfo.Add("NavBar Info", "DevExpress.XtraNavBar.Demos.NavBarInfo", "This example demonstrates how to obtain information that relates to navbar control elements (Groups, Items, ItemLinks).", Nothing, "NavBarMainDemo\NavBarInfo\NavBarInfo.vb", "Data\Tutorials\XtraNavBar\NavBarInfo.xml")
TutorialsInfo.Add("View Styles", "DevExpress.XtraNavBar.Demos.ViewStyles", "This example displays view styles which can be applied to the navbar control and demonstrates how to switch them. Select a style from the 'Views' - the result can be viewed via the NavBar Control.", Nothing, "NavBarMainDemo\ViewStyles\ViewStyles.vb", "Data\Tutorials\XtraNavBar\ViewStyles.xml")
TutorialsInfo.Add("Customizable Distances", "DevExpress.XtraNavBar.Demos.CustomizableDistances", "", Nothing, "NavBarMainDemo\CustomizableDistances\CustomizableDistances.vb", "Data\Tutorials\XtraNavBar\CustomizableDistances.xml")
TutorialsInfo.Add("Custom Draw", "DevExpress.XtraNavBar.Demos.CustomDraw", "This example demonstrates how to use CustomDraw Events for the NavBar Control.", Nothing, "NavBarMainDemo\CustomDraw\CustomDraw.vb", "Data\Tutorials\XtraNavBar\CustomDraw.xml")
End Sub
End Class
Friend Class RegisterDemos
Public Shared Sub Register()
TutorialsInfo.Add("Blending And CustomDraw", "DevExpress.XtraNavBar.Demos.frmNavBarBlending", "This demo demonstrates the XtraNAvBar's Alpha Blending feature. With this feature you can provide a background image for the control and for each individual group and customize the transparency for each element. Click one of the right images to select a background image for the corresponding group. DoubleClick the 'Image' label to set the default background.", Nothing, "", "")
TutorialsInfo.Add("Navigation Pane", "DevExpress.XtraNavBar.Demos.frmNavBarNavigationPane", "This demo demonstrates Microsoft Office 2003 Navigation Pane style. This style supports all the features introduced in MS Outlook.", Nothing, "", "")
TutorialsInfo.Add("Drag And Drop", "DevExpress.XtraNavBar.Demos.frmNavBarDragDrop", "This demo shows you how to implement internal and external Drag and Drop so that end-users can move item links both to 'Items List' and 'Recycle Bin' and from 'Items List' to the NavBar.", Nothing, "", "")
TutorialsInfo.Add("Properties", "DevExpress.XtraNavBar.Demos.frmNavBarProperties", "This demo provides the means that allow you to change the visual and behavior settings of the NavBar control and its elements (items, groups). You can also right-click a link or group to activate an option menu for it.", Nothing, "", "")
End Sub
End Class
End Namespace