当前位置: 动力学知识库 > 问答 > 编程问答 >

C# Class Header Style

问题描述:

I've got a simple style question and would like to know, what's the common pratice.

When deriving from a lot of interfaces, and all these interfaces got long names, it's time for a linebreak in the class header. Should this linebreak be BEFORE or AFTER the colon?

eg.

public class DigitalIOConfigurationViewModel

: SomeLongAbstractClassName, SomeLongInterfaceName, AndAnotherInterface

{...}

or

public class DigitalIOConfigurationViewModel :

SomeLongAbstractClassName, SomeLongInterfaceName, AndAnotherInterface

{...}

I don't know, if anybody out there cares about little things like this, but i do :)

Thanks!

网友答案:

MSDN do it like this

public class Control : Component, IDropTarget, 
    ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
网友答案:

I have mostly seen the second usage (: at the end of the type name).

I believe Resharper will indent it this way too.

分享给朋友:
您可能感兴趣的文章:
随机阅读: