public void Shutdown()
{
// take the original context pointer (it will soon be erased)
IntPtr pContext = this.InternalObject;
// shutdown (this will destroy the native context, and cause the shutdown event to be raised,
// and our OnContextShuttingDown callback will be called)
SafeNativeMethods.xnShutdown(this.InternalObject);
// remove it from the static list
RemoveContext(pContext);
// (no need to dispose. Already done as part of OnContextShuttingDown callback)
}