示例#1
0
 private static void RaiseCompleted(IntPtr cPtr, IntPtr sender, IntPtr e)
 {
     try {
         if (Noesis.Extend.Initialized)
         {
             long ptr = cPtr.ToInt64();
             if (sender == IntPtr.Zero && e == IntPtr.Zero)
             {
                 _Completed.Remove(ptr);
                 return;
             }
             CompletedHandler handler = null;
             if (!_Completed.TryGetValue(ptr, out handler))
             {
                 throw new InvalidOperationException("Delegate not registered for Completed event");
             }
             handler?.Invoke(Noesis.Extend.GetProxy(sender, false), new EventArgs(e, false));
         }
     }
     catch (Exception exception) {
         Noesis.Error.UnhandledException(exception);
     }
 }
示例#2
0
 protected virtual void OnComplete()
 {
     CompletedHandler?.Invoke(this);
 }