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); } }
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; } }
private void Cleanup(object sender, ComputeCommandStatusArgs e) { lock (CommandQueue.Events) { if (CommandQueue.Events.Contains(this)) { CommandQueue.Events.Remove(this); Dispose(); } else { FreeGCHandle(); } } }