Mini Kabibi Habibi
using System;
using System.Reflection;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.DXperience.Demos;
using DevExpress.XtraBars.Ribbon;
namespace DevExpress.XtraBars.Demos.Tutorials {
public class TutorialsInfo : DevExpress.DXperience.Demos.ModulesInfo {
const string languageDir = "CS\\";
public static void CloseCustomizationForm(Control control) {
if(control == null) return;
foreach(object obj in control.Controls)
if(obj is RibbonControl) {
((RibbonControl)obj).Visible = false;
((RibbonControl)obj).Visible = true;
}
}
public static DevExpress.Tutorials.ModuleBase ShowModule(string name, DevExpress.XtraEditors.GroupControl groupControl, DevExpress.DXperience.Demos.LookAndFeelMenu menu, DevExpress.LookAndFeel.DefaultLookAndFeel lookAndFeel) {
ModuleInfo item = TutorialsInfo.GetItem(name);
Cursor currentCursor = Cursor.Current;
Cursor.Current = Cursors.WaitCursor;
groupControl.Parent.SuspendLayout();
groupControl.SuspendLayout();
try {
Control oldTutorial = null;
if(Instance.CurrentModuleBase != null)
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;
CloseCustomizationForm(oldTutorial);
if(tutorial.ShowLookAndFeel)
menu.InitLookAndFeelMenu(lookAndFeel);
else menu.InitLookAndFeelMenu(null);
tutorial.Visible = true;
if(oldTutorial != null) oldTutorial.Visible = false;
}
finally {
groupControl.ResumeLayout(true);
groupControl.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 = DemoHelper.StringComposite(module.TutorialInfo.WhatsThisXMLFile, languageDir);
if(codeFile == "") module.TutorialInfo.WhatsThisCodeFile = DemoHelper.StringComposite(module.TutorialInfo.WhatsThisCodeFile, languageDir);
}
return module;
}
}
class RegisterTutorials {
internal static string NewFeaturesString = "DevExpress XtraBars v" + AssemblyInfo.VersionShort;
public static void Register() {
TutorialsInfo.Add(RegisterTutorials.NewFeaturesString, "DevExpress.XtraBars.Demos.Tutorials.About");
TutorialsInfo.Add("Add Bar Item Links", "DevExpress.XtraBars.Demos.Tutorials.AddBarItemLinks",
"This tutorial shows how to create and delete bar items and links.", null,
"BarTutorials\\AddBarItemLinks\\AddBarItemLinks.cs", "Data\\Tutorials\\XtraBars\\AddBarItemLinks.xml");
TutorialsInfo.Add("Add New Bar", "DevExpress.XtraBars.Demos.Tutorials.AddNewBar",
"This tutorial shows how to create and delete bars.", null,
"BarTutorials\\AddNewBar\\AddNewBar.cs", "Data\\Tutorials\\XtraBars\\AddNewBar.xml");
TutorialsInfo.Add("Bar Docking", "DevExpress.XtraBars.Demos.Tutorials.BarDocking",
"This demo shows how to dock a bar control to various sides of its owning control in code.", null,
"BarTutorials\\BarDocking\\BarDocking.cs", "Data\\Tutorials\\XtraBars\\BarDocking.xml");
TutorialsInfo.Add("Bar Item Links Info", "DevExpress.XtraBars.Demos.Tutorials.BarItemLinksInfo",
"This tutorial shows how to obtain information on items and links. The information is displayed within a separate window.", null,
"BarTutorials\\BarItemLinksInfo\\BarItemLinksInfo.cs", "Data\\Tutorials\\XtraBars\\BarItemLinksInfo.xml");
TutorialsInfo.Add("Bar Link Container Item", "DevExpress.XtraBars.Demos.Tutorials.BarLinkContainerItem",
"This tutorial demonstrates how to dynamically add links to and remove them from the BarLinkContainerItem.", null,
"BarTutorials\\BarLinkContainerItem\\BarLinkContainerItem.cs", "Data\\Tutorials\\XtraBars\\BarLinkContainerItem.xml");
TutorialsInfo.Add("Dock Panels", "DevExpress.XtraBars.Demos.Tutorials.DockPanels",
"This tutorial shows how to create dock panels and dock them to the desired edge of the container control (form). It also demonstrates how to enable the Auto-Hide feature of dock panels.", null,
"BarTutorials\\DockPanels\\DockPanels.cs", "Data\\Tutorials\\XtraBars\\DockPanels.xml");
TutorialsInfo.Add("Document Manager TabbedView", "DevExpress.XtraBars.Demos.Tutorials.DocumentManagerStart",
"This tutorial demonstrates the Tabbed MDI UI implemented via DocumenManager. DocumentManager provides centralized control over MDI child forms that are parented to the main MDI form. Click the 'Launch Sample' button to run the tutorial.", null, "", "");
TutorialsInfo.Add("Document Manager NativeMdiView", "DevExpress.XtraBars.Demos.Tutorials.DocumentManagerNativeMdiStart",
"This tutorial demonstrates the Native MDI UI implemented via DocumenManager. DocumenManager provides centralized control over MDI child forms that are parented to the main MDI form. Note that in this mode, the MDI container is painted using the current skin. Click the 'Launch Sample' button to run the tutorial.", null, "", "");
TutorialsInfo.Add("Document Manager Docking", "DevExpress.XtraBars.Demos.Tutorials.DocumentManagerDockingStart",
"This tutorial demonstrates how to integrate DocumentManager with our Docking library to emulate the document interface found in Microsoft Visual Studio 2010. Click the 'Launch Sample' button to run the tutorial.", null, "", "");
TutorialsInfo.Add("Editor Items", "DevExpress.XtraBars.Demos.Tutorials.EditorItems",
"This tutorial shows how to use Bar Edit Items. To respond to edit value changing handle the item's EditValueChanged event.", null,
"BarTutorials\\EditorItems\\EditorItems.cs", "");
TutorialsInfo.Add("Localization German", "DevExpress.XtraBars.Demos.Tutorials.LocalizationGerman",
"This demo shows how to translate the XtraBars' UI into German using the BarLocalizer object.", null,
"BarTutorials\\LocalizationGerman\\LocalizationGerman.cs", "Data\\Tutorials\\XtraBars\\LocalizationGerman.xml");
TutorialsInfo.Add("Paint Menu Bar", "DevExpress.XtraBars.Demos.Tutorials.PaintMenuBar",
"Sub-menus and popup menus can display a bar to the left of their content. This demo shows how to custom paint a menu bar by handling the PaintMenuBar event.", null,
"BarTutorials\\PaintMenuBar\\PaintMenuBar.cs", "");
TutorialsInfo.Add("Popup Control Container", "DevExpress.XtraBars.Demos.Tutorials.PopupControlContainer",
"Links that correspond to Bar Button Items can function as a dropdown. This allows the dropdown control to popup when such a link is pressed. In this tutorial, the dropdown control which allows you to specify the label's alignment is shown when the 'Text Alignment' link's dropdown button is pressed.", null,
"BarTutorials\\PopupControlContainer\\PopupControlContainer.cs", "");
TutorialsInfo.Add("Repeated Button", "DevExpress.XtraBars.Demos.Tutorials.RepeatedButton",
"This tutorial shows how to provide a simple navigation through data records. Data records can be scrolled repeatedly when the 'Previous Record' or 'Next Record' link is pressed.", null,
"BarTutorials\\RepeatedButton\\RepeatedButton.cs", "");
TutorialsInfo.Add("MDI Menu Merging", "DevExpress.XtraBars.Demos.Tutorials.MDIMenuMergingStart",
"This tutorial demonstrates the merging mechanism provided by the XtraBars. This functionality allows you to merge bars and menus of parent and child MDI forms. Click the 'Launch Sample' button to run the tutorial. The Merging options allow you to chose the MDI merge style which determines whether and when merge and unmerge mechanisms are invoked.", null, "", "");
TutorialsInfo.Add("Most Recent Files", "DevExpress.XtraBars.Demos.Tutorials.MostRecentFilesStart",
"This tutorial shows how to implement the 'Recent Files' functionality using the XtraBars. Click the 'Launch Sample' button to run the tutorial. Once a new file is opened, the path to this file is automatically added to the 'Recent Files' list. This list is represented by the BarListItem. Its Strings property represents the numerated list of strings which is repopulated after a new file has been opened.", null, "", "");
TutorialsInfo.Add("Tabbed MDI", "DevExpress.XtraBars.Demos.Tutorials.TabbedMDIStart",
"This tutorial demonstrates the tabbed MDI manager which provides centralized control over the MDI child forms that are parented to the form. When using the tabbed MDI manager, child forms are represented by tabbed pages. Click the 'Launch Sample' button to run the tutorial.", null, "", "");
TutorialsInfo.Add("Ribbon Gallery", "DevExpress.XtraBars.Demos.Tutorials.Gallery",
"This tutorial demonstrates how to work with Ribbon Galleries. You will learn how to create and populate Image Galleries, associate actions with Gallery items, customize and display super tips, etc.", null,
"BarTutorials\\Gallery\\Gallery.cs", "Data\\Tutorials\\XtraBars\\Gallery.xml");
TutorialsInfo.Add("Context Tabs", "DevExpress.XtraBars.Demos.Tutorials.ContextTabs",
"This tutorial demonstrates how to work with Ribbon page categories. By default, the Ribbon control displays all Ribbon pages within the default page category, which has no header. The Ribbon control also allows you to add custom categories with pages, which are typically used to implement contextual tabs, as that found in MS Office 2007 applications. Practice adding categories and pages, as well as changing category captions, color and alignment.", null,
"BarTutorials\\ContextTabs\\previewRibbon.cs", "Data\\Tutorials\\XtraBars\\ContextTabs.xml");
TutorialsInfo.Add("Ribbon Mini Toolbar", "DevExpress.XtraBars.Demos.Tutorials.RibbonMiniToolbar",
"This tutorial demonstrates how to work with Ribbon Mini Toolbars.", null,
"BarTutorials\\RibbonMiniToolbar\\RibbonMiniToolbar.cs", "Data\\Tutorials\\XtraBars\\RibbonMiniToolbar.xml");
TutorialsInfo.Add("Standalone BarDockControl", "DevExpress.XtraBars.Demos.Tutorials.StandaloneBDControl",
"This example demonstrates standalone bar containers represented by the StandaloneBarDockControl class. These allow bars to be displayed at any position within the form. In this example, two StandaloneBarDockControls containing bars are displayed within tab pages. Practice dragging bars to and from bar containers.", null,
"BarTutorials\\StandaloneBarDockControl\\StandaloneBDControl.cs", "Data\\Tutorials\\XtraBars\\StandaloneBarDockControl.xml");
TutorialsInfo.Add("Alert Control", "DevExpress.XtraBars.Demos.Tutorials.AlertControlTutorial",
"This example demonstrates the AlertControl component that allows notification windows to be displayed. Click the 'Show Alert Form' button to display a notification window. It will be displayed at the bottom right corner of the screen. However, you can change the form's position as well as many other options using the controls provided by the demo.", null,
"BarTutorials\\AlertControl\\AlertInfoProperties.cs;BarTutorials\\AlertControl\\AlertControlProperties.cs;BarTutorials\\AlertControl\\AlertControlTutorial.cs", "Data\\Tutorials\\XtraBars\\AlertControl.xml");
TutorialsInfo.Add("Custom Header Buttons", "DevExpress.XtraBars.Demos.Tutorials.CustomHeaderButtons",
"This demo illustrates how to use different types of custom header buttons within a DockPanel. You can choose a custom button's type (Push or Check) and its icon (a static image or unique glyph for each of the button's states) via the radio group at the top of the DockPanel. The properties grid to the right of the panel provides options for the custom button's detailed tweaking.", null,
"BarTutorials\\CustomHeaderButtons\\CustomHeaderButtons.cs;BarTutorials\\CustomHeaderButton\\ActionDockPanel.cs;BarTutorials\\CustomHeaderButton\\ButtonPropertyGrid.cs");
TutorialsInfo.Add("NonMdi DocumentManager", "DevExpress.XtraBars.Demos.Tutorials.DocumentManagerNonMdiMode",
"In this tutorial, Document Manager is hosted within a container and is not placed onto a form itself. You can use several types of container controls (such as UserControl) and add as many Document Managers to your application as required.", null,
"BarTutorials\\DocumentManager\\DocumentManagerNonMdiMode.cs");
TutorialsInfo.Add("Deferred Load Documents", "DevExpress.XtraBars.Demos.Tutorials.DocumentManagerDeferredLoadDocuments",
"This tutorial demonstrates the process of loading documents in deferred mode. At the application start-up only the first visible document is loaded and displayed. Further documents are loaded on demand - when a corresponding tab header has been clicked.", null,
"BarTutorials\\DocumentManager\\DocumentManagerDeferredLoadDocuments.cs");
TutorialsInfo.Add("Radial Menu", "DevExpress.XtraBars.Demos.Tutorials.RadialMenu",
"This example demonstrates the RadialMenu in action. Use the Ribbon controls above to change various RadialMenu options.", null,
"BarTutorials\\RadialMenu\\RadialMenu.cs");
}
}
}