Exemplo n.º 1
0
        internal static NspiContext GetContext(int contextHandle)
        {
            NspiContext result = null;

            if (!ClientContextCache.TryGetContext(contextHandle, out result))
            {
                ExTraceGlobals.NspiTracer.TraceError((long)contextHandle, "Unable to find contextHandle in context dictionary");
                throw new InvalidHandleException("Failed to find contextHandle in context dictionary.");
            }
            return(result);
        }
 // Token: 0x0600019D RID: 413 RVA: 0x00008B6C File Offset: 0x00006D6C
 public void ContextHandleRundown(IntPtr contextHandle)
 {
     if (contextHandle == IntPtr.Zero)
     {
         return;
     }
     if (!this.isShuttingDown)
     {
         NspiAsyncDispatch.ExecuteAndIgnore("ContextHandleRundown", delegate
         {
             NspiContext nspiContext = null;
             using (DisposeGuard disposeGuard = default(DisposeGuard))
             {
                 if (ClientContextCache.TryGetContext(contextHandle.ToInt32(), out nspiContext))
                 {
                     disposeGuard.Add <NspiContext>(nspiContext);
                     ClientContextCache.DeleteContext(contextHandle.ToInt32());
                     nspiContext.Unbind(true);
                 }
             }
         });
     }
 }