internal void EmitOperationPriorityChanged(DispatcherOperation op) { DispatcherHookEventHandler prio = this.OperationPriorityChanged; if (prio != null) { prio(this.owner, new DispatcherHookEventArgs(op)); } }
internal void EmitOperationAborted(DispatcherOperation op) { DispatcherHookEventHandler aborted = this.OperationAborted; if (aborted != null) { aborted(this.owner, new DispatcherHookEventArgs(op)); } }
internal void EmitOperationCompleted(DispatcherOperation op) { DispatcherHookEventHandler completed = this.OperationCompleted; if (completed != null) { completed(this.owner, new DispatcherHookEventArgs(op)); } }
internal void Reprioritize(DispatcherOperation op, DispatcherPriority oldpriority) { int oldp = (int)oldpriority; PokableQueue q = this.priorityQueues[oldp]; lock (q) { q.Remove(op); } this.Queue(op.Priority, op); this.hooks.EmitOperationPriorityChanged(op); }
private void Queue(DispatcherPriority priority, DispatcherOperation x) { int p = (int)priority; PokableQueue q = this.priorityQueues[p]; lock (q) { int flag = 1 << p; q.Enqueue(x); this.queueBits |= flag; } this.hooks.EmitOperationPosted(x); if (Thread.CurrentThread != this.baseThread) { PlatformInterface.Instance.Dispatcher.SendMessage(); } }
public DispatcherOperation BeginInvoke(DispatcherPriority priority, Delegate method, object arg, params object[] args) { if (priority < 0 || priority > DispatcherPriority.Send) { throw new InvalidEnumArgumentException("priority"); } if (priority == DispatcherPriority.Inactive) { throw new ArgumentException("priority can not be inactive", "priority"); } if (method == null) { throw new ArgumentNullException("method"); } DispatcherOperation op = new DispatcherOperation(this, priority, method, arg, args); this.Queue(priority, op); return(op); }
public object Invoke(DispatcherPriority priority, Delegate method) { if (priority < 0 || priority > DispatcherPriority.Send) { throw new InvalidEnumArgumentException("priority"); } if (priority == DispatcherPriority.Inactive) { throw new ArgumentException("priority can not be inactive", "priority"); } if (method == null) { throw new ArgumentNullException("method"); } DispatcherOperation op = new DispatcherOperation(this, priority, method); this.Queue(priority, op); PushFrame(new DispatcherFrame()); throw new NotImplementedException(); }
public DispatcherHookEventArgs(DispatcherOperation operation) { this.operation = operation; }
public DispatcherOperation BeginInvoke(DispatcherPriority priority, Delegate method, object arg, params object[] args) { if (priority < 0 || priority > DispatcherPriority.Send) { throw new InvalidEnumArgumentException("priority"); } if (priority == DispatcherPriority.Inactive) { throw new ArgumentException("priority can not be inactive", "priority"); } if (method == null) { throw new ArgumentNullException("method"); } DispatcherOperation op = new DispatcherOperation(this, priority, method, arg, args); this.Queue(priority, op); return op; }