Archive

Archive for the ‘DXCore’ Category

How to get ancestors and descendants of a type declaration using DXCore

August 29th, 2011 Comments off

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…

How to specify the CodeRush user information and use it inside text expansions

August 15th, 2011 Comments off

Note, this article has been moved to the official DevExpress Support Center site. Please refer to the moved article as it might have further updates or additional comments. Thank you.

If you use the CodeRush code templates heavily, and they specify the author of the source code, you may find the IDE | User Info options page interesting. On this page, you can specify your first, last and middle name, and then use them inside the text expansions, for example, to create a file header and specify its author.

Read more…

DXCore standard string providers list

August 15th, 2011 Comments off

DXCore string providers are functions that return strings, and can be used to provide calculated information (e.g., date/time stamps, user names, active file name, etc) inside text expansions or DXCore plug-ins.

Read more…

Creating a command line tool for source code metrics analysis

August 10th, 2011 Comments off

Recently, we have created a console application that parses an entire solution and shows summary information about declared types and the number of members in each type. Let’s tweak it a bit, so it provides more meaningful and useful information, such as a report of Maintenance Complexity (MC) code metric for a solution source code.

Read more…

DXCore Services – Synchronization

July 29th, 2011 Comments off

The Synchronization DXCore service provides methods for synchronizing thread code on Visual Studio’s foreground thread. The service is used by the CodeRush Code Issues technology for example.

Read more…

DXCore Services – RegEx (regular expressions)

July 4th, 2011 Comments off

The RegEx DXcore service provides access to the DXCore regular expressions and aliases engine.

Read more…

DXCore Services – Issues

July 4th, 2011 Comments off

The Issues DXCore service provides methods and properties for manipulating the CodeRush Code Issues Analysis.

Read more…

How to edit source files of an entire Visual Studio solution using DXCore

July 4th, 2011 Comments off

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…