OpenNI.Context.Context C# (CSharp) Method

Context() private method

private Context ( IntPtr pContext, bool addRef ) : System
pContext System.IntPtr
addRef bool
return System
        private Context(IntPtr pContext, bool addRef)
            : base(pContext)
        {
            this.errorStateChangedHandler = this.ErrorStateChangedCallback;
            this.nodeCreationHandler = this.NodeCreationCallback;
            this.nodeDestructionHandler = this.NodeDestructionCallback;

            lock (Context.staticLock)
            {
                if (Context.allContexts.ContainsKey(pContext))
                {
                    throw new GeneralException("C# wrapper: creating a Context object wrapping an already wrapped object!");
                }
                Context.allContexts.Add(pContext, this);
            }

            if (addRef)
            {
                WrapperUtils.ThrowOnError(SafeNativeMethods.xnContextAddRef(pContext));
            }

            this.shutdownHandler = OnContextShuttingDown;

            WrapperUtils.ThrowOnError(SafeNativeMethods.xnContextRegisterForShutdown(pContext, this.shutdownHandler, IntPtr.Zero, out this.shutdownCallbackHandle));
        }

Same methods

Context::Context ( ) : System
Context::Context ( IntPtr pContext ) : System
Context::Context ( string xmlFile ) : System