DXCore Services – Reflection
The Reflection DXCore service provides access to useful .NET reflection methods.
The Reflection DXCore service provides access to useful .NET reflection methods.
The Undo Stack DXCore Service provides access to the Undo Manager and undo/redo stack of the Visual Studio IDE.
The String Utilities DXCore service (accessed via the CodeRush.StrUtil object) provides utility methods for manipulating single string, multi-line texts, and string arrays.
The Caret DXCore service provides methods and properties for the code editor text caret (cursor). It allows you to move, hide, show the caret and execute many text operations, such as text insertion, deletion, and retrieving for the current caret position.
The Selection DXCore service provides methods for manipulating the selected text in the code editor.
Every programming language has its own language specification. There are numerous rules for each language that vary between programming languages. DXCore supports several programming languages and provides APIs to determine specific rules for them. These APIs are available primarly through the DXCore Language service. Let’s review the most important methods and properties of this service, comparing the CSharp (C#) and Visual Basic (VB) programming languages.
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).
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: