DXCore Tool Windows are based on the Windows Forms technology and can use only Windows Forms controls. However, if you would like to use WPF controls there is a work-around intended to use the ElementHost Windows Forms control that is used to host a Windows Presentation Foundation (WPF) element.
Read more…
Once you have a reference to an element and would like to get its declaration, simply call the GetDeclaration() method of a reference of the Expression type (all references have the Expression base type).
Read more…
Once you obtained an instance of a class, structure or an interface, for example, by using the DXCore SourceModel service:
CodeRush.Source.ActiveClass
CodeRush.Source.ActiveClassInterfaceOrStruct
CodeRush.Source.ActiveClassInterfaceStructOrModule
CodeRush.Source.ActiveStruct
CodeRush.Source.ActiveInterface
and would like to analyze its hierarchy by retrieving its base and/or derived types, you can use the following APIs:
Read more…
Usually, simple edits of text files are accomplished using the TextDocument object, which represents an open source file inside the IDE. The text document object is easy to access through the Documents DXCore service. It has lots of useful methods for editing a text like InsertText, DeleteText and SetText, which take a source code coordinates and a new text for replacement as a parameters. However, to use a text document object, it is required for the file to be opened inside the Visual Studio environment. If a file is closed, there’s no TextDocument object assigned to the file and you simply can’t use its methods. In case you are going to edit closed and/or multiple files, there’s a better way – the FileChange object (in the DevExpress.CodeRush.Core.Replacement namespace).
Read more…
According to the Embarcadero’s docwiki:
“Sync Edit mode in Delphi allows you to change all occurrences of an identifier when you change one instance of that identifier. When you enter Sync Edit mode, you can tab to each highlighted identifier in your current Code Editor window.”
The difference of the Sync Edit feature in Delphi from the usual Rename refactoring from Refactor! (for example) is that a declaration of an identifier may not exist. In this case the Rename is simple not available.
Read more…
Here’s what the standard Refactor!/Code! and “Jump to” Popup menu looks like:
Read more…
Standard DXCore plug-ins include a full set of events supported by DXCore. These events are available right on the plug-ins design surface in the Property Browser. Just choose an event from the list, double click it or press the Enter key and then write an event handler code. The majority of events have sophisticated System.EventArgs descendants that let you handle an event very easily.
Read more…
Adding a new menu entry can be easily achieved using the Action DXCore control. Just set the ParentMenu property to the name of the menu, where you would like the new item to appear. As an alternative, you can set the CommonMenu to one of the suggested values. The CommonMenu property has the DevExpress.CodeRush.Menus.VSCommonBar enumeration type, which enumerates most of common Visual Studio menu names, such as File, Edit, View, Tools, DevExpress, Help, etc.
Read more…