private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(IntPtr result, IntPtr pNative) { List <EventHandler <PropertyChangedEventArgs> > list = null; ColorFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out list); object obj = list; lock (obj) { ColorFrameSource objThis = NativeObjectCache.GetObject <ColorFrameSource>(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 { } }); } } } }
// Token: 0x06002BE6 RID: 11238 RVA: 0x000DBD5C File Offset: 0x000DA15C private void Dispose(bool disposing) { if (this._pNative == IntPtr.Zero) { return; } this.__EventCleanup(); NativeObjectCache.RemoveObject <ColorFrameSource>(this._pNative); ColorFrameSource.Windows_Kinect_ColorFrameSource_ReleaseObject(ref this._pNative); this._pNative = IntPtr.Zero; }
// Token: 0x06002BF8 RID: 11256 RVA: 0x000DC33C File Offset: 0x000DA73C public FrameDescription CreateFrameDescription(ColorImageFormat format) { if (this._pNative == IntPtr.Zero) { throw new ObjectDisposedException("ColorFrameSource"); } IntPtr intPtr = ColorFrameSource.Windows_Kinect_ColorFrameSource_CreateFrameDescription(this._pNative, format); ExceptionHelper.CheckLastError(); if (intPtr == IntPtr.Zero) { return(null); } return(NativeObjectCache.CreateOrGetObject <FrameDescription>(intPtr, (IntPtr n) => new FrameDescription(n))); }
// Token: 0x06002BF6 RID: 11254 RVA: 0x000DC2C8 File Offset: 0x000DA6C8 public ColorFrameReader OpenReader() { if (this._pNative == IntPtr.Zero) { throw new ObjectDisposedException("ColorFrameSource"); } IntPtr intPtr = ColorFrameSource.Windows_Kinect_ColorFrameSource_OpenReader(this._pNative); ExceptionHelper.CheckLastError(); if (intPtr == IntPtr.Zero) { return(null); } return(NativeObjectCache.CreateOrGetObject <ColorFrameReader>(intPtr, (IntPtr n) => new ColorFrameReader(n))); }
// Token: 0x06002BF9 RID: 11257 RVA: 0x000DC3B0 File Offset: 0x000DA7B0 private void __EventCleanup() { ColorFrameSource.Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(this._pNative); List <EventHandler <FrameCapturedEventArgs> > list = ColorFrameSource.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 (ColorFrameSource.f__mg2 == null) { ColorFrameSource.f__mg2 = new ColorFrameSource._Windows_Kinect_FrameCapturedEventArgs_Delegate(ColorFrameSource.Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler); } ColorFrameSource.Windows_Kinect_ColorFrameSource_add_FrameCaptured(pNative, ColorFrameSource.f__mg2, true); } ColorFrameSource._Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free(); } } ColorFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(this._pNative); List <EventHandler <PropertyChangedEventArgs> > list2 = ColorFrameSource.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 (ColorFrameSource.f__mg3 == null) { ColorFrameSource.f__mg3 = new ColorFrameSource._Windows_Data_PropertyChangedEventArgs_Delegate(ColorFrameSource.Windows_Data_PropertyChangedEventArgs_Delegate_Handler); } ColorFrameSource.Windows_Kinect_ColorFrameSource_add_PropertyChanged(pNative2, ColorFrameSource.f__mg3, true); } ColorFrameSource._Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free(); } } }
// Token: 0x06002BE1 RID: 11233 RVA: 0x000DBD09 File Offset: 0x000DA109 internal ColorFrameSource(IntPtr pNative) { this._pNative = pNative; ColorFrameSource.Windows_Kinect_ColorFrameSource_AddRefObject(ref this._pNative); }