Code providers for working in two-dimensional space
There are two code providers that are useful when you have written the code to work in one dimension, but if you want to create a similar code to work in a two-dimensional space, here is an example:
The code is working with rows of a grid and draws the background for them. Consider working with columns instead. Here is what the Rotate 90 Degrees code provider will produce:
The code provider modifies the code working in two-dimensional coordinate space, so it operates at a 90-degree shift. In other words, it changes the corresponding properties into neighborhood properties, such as:
- X -> Y, Y -> X;
- Height -> Width, Width -> Height;
- Horizontal -> Vertical, Vertical -> Horizontal;
- Left -> Top, Top -> Left, Right -> Bottom, Bottom -> Right;
- Column->Row, Row-> Column, Rows->Columns, Columns->Rows.
The Mirror Code code provider, in its turn, modifies the code working in two-dimensional coordinate space, so it operates at a 180-degree shift:
The code providers changes + to -, ++ to — as well as – to + and — to ++. It also converts Left to Right, Top to Bottom the same way as the Rotate 90 Degrees code provider does.
—– Products: CodeRush Pro Versions: 12.1 and up VS IDEs: 2008 and up Updated: Sep/04/2012 ID: C183