10: Advanced DSL Customization in C#

Generator Quick Response Code in C# 10: Advanced DSL Customization
10: Advanced DSL Customization
Quick Response Code Printer In C#.NET
Using Barcode printer for VS .NET Control to generate, create QR image in Visual Studio .NET applications.
The next few customizations aren t limited to your DSL de nition and its diagram; they re more strongly tied to the way your DSL is integrated into the Visual Studio environment To this end, it s helpful before going further to have a better understanding of what a DSL actually is from the point of view of the IDE and its extensibility mechanisms
Create Barcode In C#
Using Barcode encoder for VS .NET Control to generate, create barcode image in VS .NET applications.
DSL Shell Architecture
Print QR In Visual Studio .NET
Using Barcode generation for ASP.NET Control to generate, create QR Code image in ASP.NET applications.
Visual Studio is a highly extensible tool platform The product feels like a single integrated tool when you use it out of the box, but actually it s based on a core IDE shell and a set of extensibility plug-ins called packages that provide most of the functionality, such as the C# code editor and project system, the Windows Forms GUI builder, and the RAD database tools A Visual Studio package is simply a DLL that contains classes that implement a well-de ned set of interfaces to enable them to integrate into the IDE Packages can be used to add or extend almost any kind of functionality within the IDE, such as new editors, programming languages, tool windows, debuggers, and so on The Visual Studio SDK that the DSL Tools is contained in is primarily concerned with providing facilities to make this task easier You can nd much more information in the SDK s included documentation and also online at the Visual Studio 2005 Extensibility Center at http://msdn2microsoftcom/en-us/vstudio/aa700819aspx The DSL Tools add a new editor for your DSL by creating a Visual Studio Package You can nd this in the DslPackage/GeneratedCode/Packagecs le of your DSL solution We generally refer to the way the DSL is integrated into the IDE as the shell, because the IDE is providing an outer shell for your language You ll nd the base classes for code in this area in the MicrosoftVisualStudioModelingSDKShelldll The key elements of a package declaration look like this:
QR Code 2d Barcode Printer In .NET Framework
Using Barcode maker for .NET framework Control to generate, create QR image in .NET applications.
[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\80")] [PackageRegistration(RegisterUsing = RegistrationMethodAssembly, UseManagedResourcesOnly = true)] [ProvideToolWindow(typeof(MyDSLExplorerToolWindow), MultiInstances = false, Style = VsDockStyleTabbed, Orientation = ToolWindowOrientationRight,
QR Encoder In Visual Basic .NET
Using Barcode generation for Visual Studio .NET Control to generate, create QR Code image in .NET applications.
DSL Shell Archite cture
Printing Barcode In Visual C#
Using Barcode generator for VS .NET Control to generate, create bar code image in .NET applications.
Window = "{3AE79031-E1BC-11D0-8F78-00A0C9110057}")] [ProvideToolWindowVisibility(typeof(MyDSLExplorerToolWindow), ConstantsMyDSLEditorFactoryId)] [ProvideEditorFactory(typeof(MyDSLEditorFactory), 103, TrustLevel = __VSEDITORTRUSTLEVELETL_AlwaysTrusted)] [ProvideEditorExtension(typeof(MyDSLEditorFactory), "" + ConstantsDesignerFileExtension, 32)] [RegisterAsDslToolsEditor] [ComVisible(true)] internal abstract partial class MyDSLPackageBase : ModelingPackage { protected override void Initialize() { baseInitialize(); // Register the editor factory used to create the DSL editor thisRegisterEditorFactory(new MyDSLEditorFactory(this)); // Create the command set that handles menu commands // provided by this package MyDSLCommandSet commandSet = new MyDSLCommandSet(this); commandSetInitialize(); // Register the model explorer tool window for this DSL thisAddToolWindow(typeof(MyDSLExplorerToolWindow));
Making Barcode In C#
Using Barcode generation for .NET framework Control to generate, create bar code image in .NET framework applications.
You can see that the package class has a lot of custom NET attributes applied to it The way Visual Studio is told about the existence and facilities of packages is primarily by creating a set of registry entries under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\80 key This activity is known as package registration These attributes (derived from the base class RegistrationAttribute) provide a handy way of de ning those registry entries in a relatively human-readable and easily maintainable fashion They enable the DSL Tools to build infrastructure to extract the data and create the registry entries This is done on the y during a build in the IDE and also as part of creating a setup program for your DSL tool The package is the entry point into Visual Studio for your DSL and you can see from the preceding code that it has registry attributes declaring the
Draw Code 39 Extended In Visual C#.NET
Using Barcode maker for Visual Studio .NET Control to generate, create Code 39 image in VS .NET applications.
10: Advanced DSL Customization
Code128 Generation In Visual C#
Using Barcode creator for Visual Studio .NET Control to generate, create USS Code 128 image in .NET framework applications.
existence of several other interesting items that are then created in the Initialize() method: EditorFactory Creates instances of your DSL editor via the DocData and DocView classes CommandSet Implements menu commands in your DSL ToolWindow Adds extra non-editor windows (in this case, your DSL explorer) Figure 10-6 shows how these pieces t together
Data Matrix ECC200 Generation In C#
Using Barcode encoder for Visual Studio .NET Control to generate, create DataMatrix image in .NET framework applications.
Bar Code Printer In .NET
Using Barcode creation for .NET framework Control to generate, create bar code image in Visual Studio .NET applications.
Drawing Code 39 In .NET Framework
Using Barcode maker for ASP.NET Control to generate, create Code 39 image in ASP.NET applications.
Print USS Code 128 In Visual Studio .NET
Using Barcode generation for Visual Studio .NET Control to generate, create Code128 image in .NET applications.
Paint Barcode In Visual Basic .NET
Using Barcode printer for VS .NET Control to generate, create barcode image in .NET applications.
Code 39 Full ASCII Maker In VS .NET
Using Barcode generation for VS .NET Control to generate, create Code-39 image in .NET applications.