StyleManager |
![]() |
TutorialThis tutorial is intended to give you a brief overview of ProFactor StyleManager, and will guide you through the initial steps to configuring it to restyle your code exactly the way you'd like it. This is supplementary to the rest of the help file, so please check the specific topics from the Toolbar page for more detailed information about each aspect of the product. Choosing A StyleIf this is the first time you have installed StyleManager then you will need to choose your formatting style for StyleManager to use with your source code. Styles can be chosen through the Style Chooser, which you can open by clicking on the Choose Style icon.
The first thing you will want to do in this window is choose a base style from the Style Catalog. StyleManager comes pre-packaged with several different popular styles, and any one of these can be chosen by clicking on its name in the Style Catalog in the top left of the window. To the right of the window is a large text area. This is the Style Previewer. When you choose a style, the Style Previewer will automatically update to show you how your new style will affect your code. If you had a source file open within Visual Studio .NET before you opened the Style Chooser, then this source file will have been imported into StyleManager and will be previewed in the Style Previewer. Otherwise, StyleManager will show some sample code that covers many aspects of C and C++ programs. Whichever block of code you see in the Style Previewer, you will see it automatically update its formatting as you choose different styles from the Catalog. Customizing Your StyleNext you will probably want to make some modifications to your chosen style. This is done with the Style Customizer, which can be opened by clicking on the 'Customize' button below the Style Catalog. The Customizer is organized into a series of sections shown as selectable tabs. Within each tab is a set of controls for customizing the reformatting of a particular aspect of the C and C++ languages. Each aspect is split into subsections shown as grouped sets of buttons. These buttons help you find your precise styling preferences by showing you some sample code for each option you can choose. If you click on an option, you will see the Style Previewer automatically update to show you how your source code will be formatted with that option selected. In this way, you should quickly be able to set StyleManager up to accurately reflect your own style preferences. When you are done customizing the style to your liking, you can save it as a new style in the Catalog by pressing the 'Save As...' button. Once you've given your new style a name, you can return to Visual Studio .NET by pressing the 'OK' button. Restyling A FileWith your style now chosen, restyling a file is as easy as a single mouse click. Open a file you would like to restyle within Visual Studio .NET, then just press the 'Restyle File' icon.
StyleManager will restyle the file you are currently viewing, in place. You'll notice after restyling a file that Visual Studio .NET marks the file as modified (with an asterisk in the title bar). If you press Control-Z now (or whatever key combination you've associated with 'Undo'), the changes will be undone, just as if you'd made the changes yourself. This means that you never need to worry about trying out a style on a file: StyleManager will always make the changes as safely as possible. If you're happy with the changes, just save the file as normal. Do be aware, however, that depending on how you've configured Visual Studio .NET, the IDE may be set to automatically save any changed files when you compile your projects. You will still be able to undo StyleManager's changes just like any other change, but it's still worth making sure you're happy with the changes before continuing with other work. Restyling The Current SelectionStyleManager also supports restyling sections of a single file. Simply select the body of code you wish to restyle, then click the 'Restyle Selection' icon.
The selected code will then be restyled in isolation. Selection restyles are also stored in the undo buffer, so you can inspect the changes before proceeding. If your chosen style specifies indentation rules that are substantially different to those used by the current file, you may find the indentation of the selected code appears different to that of the rest of the code. In such cases it is recommended that Visual Studio's tabulation controls are used to adjust the indentation to match the rest of the file, by pressing Tab or Shift-Tab accordingly. Restyling A ProjectStyleManager is able to restyle whole projects at a time. If you need to restyle a whole project to your chosen style, first select the project to restyle within the solution browser, then click the 'Restyle Project' icon.
Project restyles are slightly more complex than single file restyles, so before commencing with a project restyle, please check the Restyle Project help page. This can also be accessed by pressing the 'Help' button on the Restyle Project Dialog. Product RegistrationIf you've purchased a full product license for StyleManager then you will need to unlock the product with your License ID. Please check the Licenses page for details of the activation process. | ||||
|
|