Refactorings for concatenating and splitting strings

November 25th, 2011 Comments off

Concatenation is the process of appending one string to the end of another string. A string is basically a sequence of Unicode characters. An important property of strings is that they are read-only (immutable). Once a string has been created, it cannot be changed. So, when a string is updated, the .NET framework actually discards the original string and creates a new string. In other words, the concatenation of strings is creating an entirely new string, allocating enough memory for everything, copying all the data from the existing values of all concatenated strings and then copying the data from each string. As the string grows, the amount of data it has to copy each time grows too. Having already concatenated strings allows you to avoid such problems.

Read more…

DXCore Services – Strings

November 22nd, 2011 Comments off

The Strings DXCore service manipulates DXCore string providers. It has methods that expand and format string providers for further expansion inside the code editor using the DXCore plug-ins.

Read more…

DXCore Services – CodeStyle

November 22nd, 2011 Comments off

The Code Style DXCore service provides methods and properties that specify user code style formatting settings, such as: prefixes and suffixes of locals, fields, properties and other declarations, a default visibility scope for types, members and others.

Read more…

DXCore Services – Documents

November 22nd, 2011 Comments off

The Documents DXCore service provides an API to control opening and closing documents inside the Visual Studio IDE. You can insert, remove and change any text at the specified coordinates of the given documents.

Read more…

DXCore Services – EditPoints

November 22nd, 2011 Comments off

The EditPoints DXCore service provides methods for creating edit points. Edit points allow you to manipulate text as data in text buffers. The service is hidden from Intellisense, and it contains only different overloads of the New method to create edit points, such as:
Read more…

DXCore Services – Content

November 22nd, 2011 Comments off

The Content DXCore service provides methods for accessing content providers. Content providers are a common object for refactoring operations and code providers which modify source code.

Read more…

Code Issues – Member is not implemented

October 31st, 2011 Comments off

Cause:

The Member is not implemented code issue of the warning type is shown for the members that do not provide an implementation. Not providing an implementation may be a sign of incomplete code.

The code issue is shown for non-interface, non-abstract, non-virtual, non-extern members – both methods and properties. It is not shown for constructors and destructors of a class.

Read more…

Converting methods to functions or procedures

October 31st, 2011 Comments off

The simplest type of method is one that performs a task without requiring any parameters and without returning any information – let’s call them procedures (or void methods). Methods that use some type as the return value – are functions.

Sometimes, when we declare a method with a return value, we may realize that we don’t actually need this return value, and instead, need a simple void method that does not return anything. On the other hand, we marked a method as void, but may require it to be a function, returning a value.

Read more…