BT

Sync Block Edit Simplifies Code Editing

by Anand Narayanaswamy on Dec 30, 2012 |

Sync Block Edit is a Visual Studio extension which automatically updates duplicate blocks of text in multiple files. It will be useful for updating the content in copyright files inside the source code in large applications or for updating large chunks of content such as comments. The extension can be accessed from the Visual Studio 2012 toolbar after the installation of VSIX file.

In order to work with Sync Block Edit extension you have to follow the steps:

  • Enclose the content inside one of the source file with a distinct begin and end signature lines

// BEGIN copyright starts
// Your content here
// END copyright ends

  • Select the block and click the Sync Update Block button from the Sync Block Edit toolbar

For example, if you have two forms (Form1 and Form2) in your Windows application, you only need to make the required change in Form1. The required changes will be automatically reflected in Form2.

Let us visually examine the usage of Sync Block Edit extension

Form1 with original content




Form2 with original content



Form1 with changes - Sync Update Block in Action



Update Text Dialog

You can select a required choice from the Target drop down. By default, the begin and end lines are populated with the required text from the source file.

Log Report



Form2 with changes



As you can observe from the above screenshots, I have only updated the content in Form1.

If you have not added the distinct begin and end blocks then you can create it using Sync Create Block button from the Sync Block Edit toolbar.

Create Block

  • Select the content for which you want to add begin and end blocks
  • Provide the content for the begin and end blocks
  • Select the target
  • Click the Create button

Block Added

The extension automatically adds the required begin and end lines depending upon the target you selected. If you select Entire Solution as target the block will be placed on all the files of the project.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT