Quick ways to add and remove a set/get property accessor with CodeRush
A property without a ‘set’ accessor is considered read-only:
A property without a ‘set’ accessor is considered read-only:
When working with arrays and lists enumerating all of its items we usually create a for loop statement as follows:
The CSharp and Visual Basic programming language specifications have several restrictions on how type elements such as a class, structure, and delegate are declared in the code. Let’s review code issues that demonstrate an incorrect type declaration, and see the error before the compiler informs us about it when we build the code.
Since ancient times, CodeRush has supported the INotifyPropertyChanged interface implementation. The interface provides a standard way to notify binding clients of a property value change. It has just one event, with a simple and clear name, PropertyChanged.
The most important part of the support of this interface is connected to the code templates. Once you expand a property template in a class that implements the INotifyPropertyChanged interface, you will see the corresponding code generated. For instance, expanding the ‘ps’ template will produce the following code:
The Visual Studio IDE has a great box selection feature that allows you to select a rectangular region of text within the code editor by holding down the Alt key while selecting the text region with the mouse:
The Unit Test Runner has two dedicated option pages in the Options Dialog. The first one is called Test Runner inside the Unit Testing category. It provides you with the capability to tweak the system settings of the Unit Testing Service as well as required paths to the testing frameworks. The second option page named Test Runner Window allows you to configure the Test Runner tool window, its behavior and visual appearance preferences. Let’s take a closer look at both options pages.
The following code declaration features are available in CodeRush for generating new type declarations (in alphabetical order). Click on the name to learn more about a specific code provider.
Creates an ancestor class for an active type. Active type becomes a descendant of the created ancestor class.
Creates a descendant class providing overrides for abstract members.
Attributes provide a powerful method of associating declarative information by decorating elements of the code, such as types, methods, properties, parameters and assemblies. Once an attribute is associated with a program entity, it can be queried at run time and used in various cases, for example, associating a help document with program entities (via the Help attribute), or marking an item as out of date (via the Obsolete attribute).