Esempio n. 1
0
        protected virtual void OnAborted(object sender, ComputeCommandStatusArgs evArgs)
        {
#if DEBUG
            Trace.WriteLine("Abort " + Type + " operation of " + this + ".", "Information");
#endif
            if (aborted != null)
            {
                aborted(sender, evArgs);
            }
        }
Esempio n. 2
0
        private void StatusNotify(IntPtr eventHandle, int cmdExecStatusOrErr, IntPtr userData)
        {
            status = new ComputeCommandStatusArgs(this, (ComputeCommandExecutionStatus)cmdExecStatusOrErr);

            switch (cmdExecStatusOrErr)
            {
            case (int)ComputeCommandExecutionStatus.Complete:
                OnCompleted(this, status);
                break;

            default:
                OnAborted(this, status);
                break;
            }
        }
Esempio n. 3
0
 private void Cleanup(object sender, ComputeCommandStatusArgs e)
 {
     lock (CommandQueue.Events)
     {
         if (CommandQueue.Events.Contains(this))
         {
             CommandQueue.Events.Remove(this);
             Dispose();
         }
         else
         {
             FreeGCHandle();
         }
     }
 }