C
Claire
I want to declare a set of descendent exception classes that contains no
extra code to the base. It's so I can test the class type of exception and
handle its error code differently depending on the exception that was
thrown.
I come from a delphi background so for this I would have something like
type ClassA = class
public
constructor create(errormessage : message; errorcode : integer);
end;
type ClassB = classA;
type ClassC = classA;
I don't seem to be able to get the syntax correct for C#. The following are
examples of what Ive tried so far. Ive looked for book examples but they
always seem to show derived classes that have extra functionality.
public class LastErrorException : CommException;
public class LastErrorException : CommException{};
public class LastErrorException = CommException;
public class LastErrorException = CommException{};
thanks
extra code to the base. It's so I can test the class type of exception and
handle its error code differently depending on the exception that was
thrown.
I come from a delphi background so for this I would have something like
type ClassA = class
public
constructor create(errormessage : message; errorcode : integer);
end;
type ClassB = classA;
type ClassC = classA;
I don't seem to be able to get the syntax correct for C#. The following are
examples of what Ive tried so far. Ive looked for book examples but they
always seem to show derived classes that have extra functionality.
public class LastErrorException : CommException;
public class LastErrorException : CommException{};
public class LastErrorException = CommException;
public class LastErrorException = CommException{};
thanks