[300] Interesting Code Reformatting

Hi,

i have following code

protected override object GetElementKey(ConfigurationElement element)
{
ServiceSettings settings = (ServiceSettings) element;
return settings.Assembly == null ? string.Empty : settings.Assembly +
settings.Namespace == null ? string.Empty : settings.Namespace +
settings.Type == null ? string.Empty : settings.Type.FullName;
}

Should join some strings and test on null. Maybe don't look so well
because Thunderbird make some line break.

Visual Studio Formatting leave them ok. But the R# Code formatting, with
default settings since installation, creates this.

protected override object GetElementKey(ConfigurationElement element)
{
ServiceSettings settings = (ServiceSettings) element;
return settings.Assembly == null
? string.Empty
: settings.Assembly +
settings.Namespace == null
? string.Empty
: settings.Namespace +
settings.Type == null
? string.Empty
: settings.Type.FullName;
}

Very interesting!

Regards

Albert
http://der-albert.com

Please sign in to leave a comment.