Append :this(required params)
at the end of the constructor to do 'constructor chaining'
public Test( bool a, int b, string c )
: this( a, b )
{
this.m_C = c;
}
public Test( bool a, int b, float d )
: this( a, b )
{
this.m_D = d;
}
private Test( bool a, int b )
{
this.m_A = a;
this.m_B = b;
}
Source Courtesy of csharp411.com
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…