private static void RaisePreviewExecuted(IntPtr cPtr, IntPtr sender, IntPtr e) { try { if (!_PreviewExecuted.ContainsKey(cPtr)) { throw new InvalidOperationException("Delegate not registered for PreviewExecuted event"); } if (sender == IntPtr.Zero && e == IntPtr.Zero) { _PreviewExecuted.Remove(cPtr); return; } if (Noesis.Extend.Initialized) { PreviewExecutedHandler handler = _PreviewExecuted[cPtr]; if (handler != null) { handler(Noesis.Extend.GetProxy(sender, false), new ExecutedRoutedEventArgs(e, false)); } } } catch (Exception exception) { Noesis.Error.SetNativePendingError(exception); } }
private static void RaisePreviewExecuted(IntPtr cPtr, IntPtr sender, IntPtr e) { try { if (Noesis.Extend.Initialized) { long ptr = cPtr.ToInt64(); if (sender == IntPtr.Zero && e == IntPtr.Zero) { _PreviewExecuted.Remove(ptr); return; } PreviewExecutedHandler handler = null; if (!_PreviewExecuted.TryGetValue(ptr, out handler)) { throw new InvalidOperationException("Delegate not registered for PreviewExecuted event"); } handler?.Invoke(Noesis.Extend.GetProxy(sender, false), new ExecutedRoutedEventArgs(e, false)); } } catch (Exception exception) { Noesis.Error.UnhandledException(exception); } }