Hello,
Is there a way to configure Visual Studio 2005 to reformat the C#
source code automatically when a file opens?
I worked with several dozens of C# developers at work, open-source
developers and freelances; and, everyone has his/her own different
preference on code formatting. And coming up with a code standards
that everyone has to conform does not work, because most of them come
and go very often.
It's hard enough to understand the program logic. Reading the codes
with different formats makes it harder, sometimes. Can you image
reading through thousands and thousands of lines of codes looking as
cryptic as this? (my apologies to those who do :-)
public string Name { get { return _name; } set { _name = value; } }
Personally, I prefer it like this:
public string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}
Then again, someone else may prefer it differently:
public string Name {
get { return _name; }
set { _name = value; }
}
And then there are many others tastes as well. Wouldn't it be nice to
tell Visual Studio do format the code "your way"? Without saving
it... of course. (That keeps the original developer happy.)
Many thanks.
- Steve Pham, Senior Software Developer, MCP