Ejemplo n.º 1
0
        private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(IntPtr result, IntPtr pNative)
        {
            List <EventHandler <PropertyChangedEventArgs> > list = null;

            DepthFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out list);
            object obj = list;

            lock (obj)
            {
                DepthFrameSource         objThis = NativeObjectCache.GetObject <DepthFrameSource>(pNative);
                PropertyChangedEventArgs args    = new PropertyChangedEventArgs(result);
                using (List <EventHandler <PropertyChangedEventArgs> > .Enumerator enumerator = list.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        EventHandler <PropertyChangedEventArgs> func = enumerator.Current;
                        EventPump.Instance.Enqueue(delegate
                        {
                            try
                            {
                                func(objThis, args);
                            }
                            catch
                            {
                            }
                        });
                    }
                }
            }
        }
Ejemplo n.º 2
0
 // Token: 0x06002C5A RID: 11354 RVA: 0x000DD254 File Offset: 0x000DB654
 private void Dispose(bool disposing)
 {
     if (this._pNative == IntPtr.Zero)
     {
         return;
     }
     this.__EventCleanup();
     NativeObjectCache.RemoveObject <DepthFrameSource>(this._pNative);
     DepthFrameSource.Windows_Kinect_DepthFrameSource_ReleaseObject(ref this._pNative);
     this._pNative = IntPtr.Zero;
 }
Ejemplo n.º 3
0
        // Token: 0x06002C6E RID: 11374 RVA: 0x000DD81C File Offset: 0x000DBC1C
        public DepthFrameReader OpenReader()
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("DepthFrameSource");
            }
            IntPtr intPtr = DepthFrameSource.Windows_Kinect_DepthFrameSource_OpenReader(this._pNative);

            ExceptionHelper.CheckLastError();
            if (intPtr == IntPtr.Zero)
            {
                return(null);
            }
            return(NativeObjectCache.CreateOrGetObject <DepthFrameReader>(intPtr, (IntPtr n) => new DepthFrameReader(n)));
        }
Ejemplo n.º 4
0
        // Token: 0x06002C6F RID: 11375 RVA: 0x000DD890 File Offset: 0x000DBC90
        private void __EventCleanup()
        {
            DepthFrameSource.Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(this._pNative);
            List <EventHandler <FrameCapturedEventArgs> > list = DepthFrameSource.Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[this._pNative];
            object obj = list;

            lock (obj)
            {
                if (list.Count > 0)
                {
                    list.Clear();
                    if (this._pNative != IntPtr.Zero)
                    {
                        IntPtr pNative = this._pNative;
                        if (DepthFrameSource.f__mg2 == null)
                        {
                            DepthFrameSource.f__mg2 = new DepthFrameSource._Windows_Kinect_FrameCapturedEventArgs_Delegate(DepthFrameSource.Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
                        }
                        DepthFrameSource.Windows_Kinect_DepthFrameSource_add_FrameCaptured(pNative, DepthFrameSource.f__mg2, true);
                    }
                    DepthFrameSource._Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
                }
            }
            DepthFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(this._pNative);
            List <EventHandler <PropertyChangedEventArgs> > list2 = DepthFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[this._pNative];
            object obj2 = list2;

            lock (obj2)
            {
                if (list2.Count > 0)
                {
                    list2.Clear();
                    if (this._pNative != IntPtr.Zero)
                    {
                        IntPtr pNative2 = this._pNative;
                        if (DepthFrameSource.f__mg3 == null)
                        {
                            DepthFrameSource.f__mg3 = new DepthFrameSource._Windows_Data_PropertyChangedEventArgs_Delegate(DepthFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
                        }
                        DepthFrameSource.Windows_Kinect_DepthFrameSource_add_PropertyChanged(pNative2, DepthFrameSource.f__mg3, true);
                    }
                    DepthFrameSource._Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
                }
            }
        }
Ejemplo n.º 5
0
 // Token: 0x06002C55 RID: 11349 RVA: 0x000DD201 File Offset: 0x000DB601
 internal DepthFrameSource(IntPtr pNative)
 {
     this._pNative = pNative;
     DepthFrameSource.Windows_Kinect_DepthFrameSource_AddRefObject(ref this._pNative);
 }