ASN1C C# Runtime Library  7.3
Public Member Functions | Public Attributes | List of all members
Asn1Context Class Reference

Public Member Functions

void EnableElementTracking ()
 
String GetCurrentElement ()
 

Public Attributes

Asn1NamedEventDispatcher EventDispatcher
 

Detailed Description

This class is a holder for things which are to be contained in an encoder or decoder. Since we have multiple base classes for encoders/decoders (Asn1MessageBuffer and Asn1OutputStream), this class provides a single container for all of those things which would otherwise be contained in the various base classes.

This class also provides a location for some convenience methods related to the contained objects (e.g. getCurrentElement).

Thread-safety: a given instance of this class should be accessed by a single thread.

/p>

Member Function Documentation

◆ EnableElementTracking()

void EnableElementTracking ( )

Enable element name tracking. This can be useful for error reporting. Element name tracking must be enabled for getCurrentElement to be of any use.

◆ GetCurrentElement()

String GetCurrentElement ( )

Return the name of the current element. This is only useful if you have called enableElementTracking at the start of encoding/decoding. The name returned will be in the form element1.element2..., If you have not enabled element tracking, an exception will be thrown.

Member Data Documentation

◆ EventDispatcher

Asn1NamedEventDispatcher EventDispatcher
Initial value:
=
new Asn1NamedEventDispatcher()

The named event dispatcher for this context. /p>

Referenced by Asn1OpenExt.SetOpenType().