private static void Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result,
                                                                                          RootSystem.IntPtr pNative)
        {
            List <RootSystem.EventHandler <InfraredFrameArrivedEventArgs> > callbackList = null;

            Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
            lock (callbackList)
            {
                var objThis = NativeObjectCache.GetObject <InfraredFrameReader>(pNative);
                var args    = new InfraredFrameArrivedEventArgs(result);
                foreach (var func in callbackList)
                {
                    EventPump.Instance.Enqueue(() =>
                    {
                        try
                        {
                            func(objThis, args);
                        }
                        catch
                        {
                        }
                    });
                }
            }
        }
Ejemplo n.º 2
0
        private static void Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handler(IntPtr result, IntPtr pNative)
        {
            List <EventHandler <InfraredFrameArrivedEventArgs> > list = null;

            InfraredFrameReader.Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out list);
            object obj = list;

            lock (obj)
            {
                InfraredFrameReader           objThis = NativeObjectCache.GetObject <InfraredFrameReader>(pNative);
                InfraredFrameArrivedEventArgs args    = new InfraredFrameArrivedEventArgs(result);
                using (List <EventHandler <InfraredFrameArrivedEventArgs> > .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        EventHandler <InfraredFrameArrivedEventArgs> func = enumerator.Current;
                        EventPump.Instance.Enqueue(delegate
                        {
                            try
                            {
                                func(objThis, args);
                            }
                            catch
                            {
                            }
                        });
                    }
                }
            }
        }
 // Token: 0x06002CAC RID: 11436 RVA: 0x000DDED4 File Offset: 0x000DC2D4
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <InfraredFrameArrivedEventArgs>(this._pNative);
     InfraredFrameArrivedEventArgs.Windows_Kinect_InfraredFrameArrivedEventArgs_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
 // Token: 0x06002CA7 RID: 11431 RVA: 0x000DDE80 File Offset: 0x000DC280
 internal InfraredFrameArrivedEventArgs(IntPtr pNative)
 {
     this._pNative = pNative;
     InfraredFrameArrivedEventArgs.Windows_Kinect_InfraredFrameArrivedEventArgs_AddRefObject(ref this._pNative);
 }