Пример #1
0
 private static void RaiseOpened(IntPtr cPtr, IntPtr sender, IntPtr e)
 {
     try {
         if (!_Opened.ContainsKey(cPtr))
         {
             throw new InvalidOperationException("Delegate not registered for Opened event");
         }
         if (sender == IntPtr.Zero && e == IntPtr.Zero)
         {
             _Opened.Remove(cPtr);
             return;
         }
         if (Noesis.Extend.Initialized)
         {
             OpenedHandler handler = _Opened[cPtr];
             if (handler != null)
             {
                 handler(Noesis.Extend.GetProxy(sender, false), new EventArgs(e, false));
             }
         }
     }
     catch (Exception exception) {
         Noesis.Error.UnhandledException(exception);
     }
 }
Пример #2
0
 private static void RaiseOpened(IntPtr cPtr, IntPtr sender, IntPtr e)
 {
     try {
         if (Noesis.Extend.Initialized)
         {
             long ptr = cPtr.ToInt64();
             if (sender == IntPtr.Zero && e == IntPtr.Zero)
             {
                 _Opened.Remove(ptr);
                 return;
             }
             OpenedHandler handler = null;
             if (!_Opened.TryGetValue(ptr, out handler))
             {
                 throw new InvalidOperationException("Delegate not registered for Opened event");
             }
             handler?.Invoke(Noesis.Extend.GetProxy(sender, false), new EventArgs(e, false));
         }
     }
     catch (Exception exception) {
         Noesis.Error.UnhandledException(exception);
     }
 }