예제 #1
0
        protected virtual void OnTasksAdded(ICollection <KeyValuePair <int, T> > pairs)
        {
            EventHandler <TaskAddedEventArgs <T> > handler = TaskAdded;

            if (handler != null)
            {
                TaskAddedEventArgs <T> e = new TaskAddedEventArgs <T> (pairs);

                if (commandQueue != null)
                {
                    commandQueue.Register(new EventWrapper <TaskAddedEventArgs <T> > (
                                              handler, this, e)
                                          );
                }
                else
                {
                    handler(this, e);
                }
            }
        }
예제 #2
0
        protected virtual void OnTaskAdded(int pos, T task)
        {
            EventHandler <TaskAddedEventArgs <T> > handler = TaskAdded;

            if (handler != null)
            {
                TaskAddedEventArgs <T> e = new TaskAddedEventArgs <T> (pos, task);

                if (commandQueue != null)
                {
                    commandQueue.Register(
                        new EventWrapper <TaskAddedEventArgs <T> > (handler, this, e)
                        );
                }
                else
                {
                    handler(this, e);
                }
            }
        }