T
Thana at Thailand
Thanks Peter Duniho,
Your solution is impressed me. I never thought about it before.
So, your solution is to use child class constructor argument in the same
format as the base class constructor argument to avoid complex
processing of argument.
Then use a static method (as factory) that parse the complex argument to
simple arguments and use that to create child class instead.
This solution relieves me very much.
Your solution is impressed me. I never thought about it before.
So, your solution is to use child class constructor argument in the same
format as the base class constructor argument to avoid complex
processing of argument.
Then use a static method (as factory) that parse the complex argument to
simple arguments and use that to create child class instead.
quote said:class MyException : Exception
{
public MyException(string severity, string errCode, string message)
: base(message)
{
this.severity = severity;
this.errCode = errCode;
}
public static MyException FromFullMessage(string fullMsg)
{
// split string here, then...
return new MyException(severity, errCode, message);
}
}
This solution relieves me very much.