Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refine code in visual c#?

Tags:

c#

recently I have seen this code

        arrMove                         = new List<int[]>(4);
        m_pppiCaseMoveDiagLine          = new int[64][][];
        m_pppiCaseMoveDiagonal          = new int[64][][];
        m_pppiCaseMoveLine              = new int[64][][];
        m_ppiCaseMoveKnight             = new int[64][];
        m_ppiCaseMoveKing               = new int[64][];
        m_ppiCaseWhitePawnCanAttackFrom = new int[64][];
        m_ppiCaseBlackPawnCanAttackFrom = new int[64][];

but i couldn't know how to make my code look like this one using visual c# 2010 ,do you know any shortcut or tool to do that automatically?.

EDIT

i have also another related question, if i want to align declarations like this

    private PlayerColorE                m_eNextMoveColor;
    private int[]                       m_piPiecesCount;
    private Random                      m_rnd;
    private int                         m_iAttackedPieces;

-it seems that it can't be done using prductivity power tools extension-

do you have any idea how to do it?

thanks alot for your help!

like image 283
George Avatar asked Aug 22 '10 16:08

George


People also ask

How do you Refactor code in VS code?

Clicking on the Code Action lightbulb or using the Quick Fix command Ctrl+. will display Quick Fixes and refactorings. If you'd just like to see refactorings without Quick Fixes, you can use the Refactor command (Ctrl+Shift+R).

What is refactoring in Visual Studio?

Applies to: Visual Studio Visual Studio for Mac Visual Studio Code. Refactoring is the process of modifying code in order to make it easier to maintain, understand, and extend, but without changing its behavior.


1 Answers

You might want to take a look at the Productivity Power Tools extension for Visual Studio 2010 and its Align Assignments feature.

like image 155
Bertrand Marron Avatar answered Oct 05 '22 03:10

Bertrand Marron