Archive

Author Archive

Code Issues – Can implement base type constructors

April 26th, 2011 Comments off

Cause:

The Can Implement base type constructor code issue of type hint suggests that you implement the constructors that are missing for the current class, but exist in the ancestor (base) class.

For instance, once you implement your custom exception class derived from the System.Exception, you have to provide the full set of its constructors. Failure to provide all of the constructors of the Exception class can make it difficult to correctly handle exceptions. For example, the constructor with the signature “Exception(string, Exception)” is used to create exceptions that are caused by other exceptions. Without this constructor, you cannot create and throw an instance of your exception descendant that contains an inner exception, which is what managed code should do in such situations.

Read more…

Browsing recently accessed files in Visual Studio using CodeRush

April 25th, 2011 Comments off

CodeRush has a special tool window for browsing recently opened (accessed) files inside Visual Studio called Browse Recent Files. It is available via the corresponding File -> Browse Recent Files… menu item, or via the Ctrl+Shift+. (dot at the end) shortcut. This is what it looks like:

CodeRush Recent Files preview

Read more…

DXCore Services – Serialization

April 22nd, 2011 Comments off

The Serialization DXCore service provides methods for objects serialization (saving and loading). It can be used to load CodeRush Code tempalates.

Read more…

DXCore Services – Templates

April 22nd, 2011 Comments off

The Templates DXCore service provides CodeRush Code Templates APIs and some additional text expansion services. Using this service, you can programmatically create your own templates and/or modify the existing ones.

Read more…

How to load/change CodeRush templates from inside your DXCore plug-in

April 22nd, 2011 Comments off

CodeRush code templates are stored inside serialized objects (binary and XML files) as opposed to usual DXCore plug-ins settings storage mechanism. If you’d like to load templates (e.g. to dump and print some templates categories) you can use the DXCore Templates and Serialization services.

Read more…

How to read/write different DXCore setting files from your own plug-in

April 22nd, 2011 Comments off

Sometimes, when developing a DXCore plug-in, you might need to know what settings other CodeRush or Refactor! features have. For example, it might be necessary to know if the particular feature is enabled or disabled to not intersect with it; or change a feature’s default settings from inside your own plug-in. This way, you can tweak any settings programmatically without opening the Options Dialog.

Read more…

Intelligent code lines enhancement and modification using the Duplicate Line feature

April 19th, 2011 Comments off

The Duplicate Line CodeRush feature intelligently creates a copy of an existing line of code, allowing you to easily modify it. If the code line is recognized as a predefined pattern, the line is copied and a portion of it is selected for further modification. Note that some code line bits can be modified automatically for you as well.

The predefined duplication patterns are configurable. They are stored and presented as regular expressions that contain one or several DXCore built-in reg-ex aliases for easy understanding. If the line doesn’t match any of the existing patterns – nothing happens, by default. However, there an option to copy-paste the entire line of the text if no matches are found when the feature is performed. All available options are listed later.

Read more…

Smart Constructor – Generating advanced type constructors in three keystrokes

April 19th, 2011 Comments off

The Smart Constructor CodeRush feature allows you to add constructors to the current class or structure, and pass type members, like fields and properties for initialization through its parameters. Creating a constructor is as simple as just typing three keys: “cc & Space”:

CodeRush Smart Constructor preview

Read more…