C#代码规范——成员分段
print?class Sample : BaseClass, IIntf1
{
#region Enumerations
enum EnumType
{
Const1,
// ...
}
#endregion
#region Nested types
public class PubNestedClass
{
// ...
}
private class PrivNestedClass
{
}
#endregion
#region Properties
#region IIntf1 members
#region IIntf1.1 members // an inte易做图ce that IIntf1 implements if any
// ...
#endregion
public int Id { get; private set; }
#endregion
public string Name { get; private set; }
private int PrivProperty { get; set; }
public static int Count { get; private set; }
#endregion
#region Constructors
public Sample(int a, int b)
{
// ...
}
public Sample(int a) : this(a,0)
{
// ...
}
private Sample()
{
}
static Sample()
{
}
~Sample()
{
}
#endregion
#region Methods
// ...
#endregion
#region Fields
private int _privField;
private const _constantField;
private static _staticField;
#endregion
}
class Sample : BaseClass, IIntf1
{
#region Enumerations
enum EnumType
{
Const1,
// ...
}
#endregion
#region Nested types
public class PubNestedClass
{
// ...
}
private class PrivNestedClass
{
}
#endregion
#region Properties
#region IIntf1 members
#region IIntf1.1 members // an inte易做图ce that IIntf1 implements if any
// ...
#endregion
public int Id { get; private set; }
#endregion
public string Name { get; private set; }
private int PrivProperty { get; set; }
public static int Count { get; private set; }
#endregion
#region Constructors
public Sample(int a, int b)
{
// ...
}
public Sample(int a) : this(a,0)
{
// ...
}
private Sample()
{
}
static Sample()
{
}
~Sample()
{
}
#endregion
#region Methods
// ...
#endregion
#region Fields
private int _privField;
private const _constantField;
private static _staticField;
#endregion
}
补充:软件开发 , C# ,