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));
     }
 }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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();
            }
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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;
 }
Beispiel #9
0
 public DispatcherHookEventArgs(DispatcherOperation operation)
 {
     this.operation = operation;
 }
Beispiel #10
0
        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();
            }
        }
Beispiel #11
0
        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);
        }
Beispiel #12
0
        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();
        }
Beispiel #13
0
        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;
        }