private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative) { List <RootSystem.EventHandler <Windows.Kinect.FrameCapturedEventArgs> > callbackList = null; Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList); lock (callbackList) { var objThis = Helper.NativeObjectCache.GetObject <BodyIndexFrameSource>(pNative); var args = new Windows.Kinect.FrameCapturedEventArgs(result); foreach (var func in callbackList) { Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } }); } } }
private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative) { List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null; Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList); lock(callbackList) { var objThis = Helper.NativeObjectCache.GetObject<BodyFrameSource>(pNative); var args = new Windows.Kinect.FrameCapturedEventArgs(result); foreach(var func in callbackList) { #if UNITY_METRO || UNITY_XBOXONE UnityEngine.WSA.Application.InvokeOnAppThread(() => { try { func(objThis, args); } catch { } }, true); #else Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } }); #endif } } }
private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative) { List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null; Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList); lock(callbackList) { var objThis = Helper.NativeObjectCache.GetObject<BodyFrameSource>(pNative); var args = new Windows.Kinect.FrameCapturedEventArgs(result); foreach(var func in callbackList) { Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } }); } } }
private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative) { if (!Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.ContainsKey(pNative)) { Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[pNative] = new List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>(); } var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[pNative]; lock(callbackList) { try { var objThis = Helper.NativeObjectCache.GetObject<AudioSource>(pNative); var args = new Windows.Kinect.FrameCapturedEventArgs(result); foreach(var func in callbackList) { if(func != null) { func(objThis, args); } } } catch { } } }