Class Declaration

Next comes the class declaration. It is of the following form:

   public class <ProdName> : <BaseClass>

<ProdName> is the name of the production in the ASN.1 source file. <BaseClass> is a class from which the type is derived. This can either be a standard run-time or compiler-generated class. In our example, the EmployeeNumber is an INTEGER, so we can directly inherit the Asn1Integer run-time base class. If we had a declaration such as the following:

   EmployeeSSNumber ::= [APPLICATION 22] EmployeeNumber

Our EmployeeSSNumber class would be inherited from the compiler-generated EmployeeNumber class as follows:

   public class EmployeeSSNumber : EmployeeNumber

Note: the preceding example is not true if –compact is specified. In that case, all intermediate classes would be removed so EmployeeSSNumber would inherit Asn1Integer as in the first case.