示例#1
0
 protected virtual void OnAnimationCompleted(AnimationCompletedEventArg e)
 {
     if (this.AnimationCompleted != null)
     {
         this.AnimationCompleted(this, e);
     }
 }
示例#2
0
        public void ClearQueue()
        {
            List <QueueItem> list = null;

            lock (this.queue)
            {
                list = new List <QueueItem>(this.queue);
                this.queue.Clear();
            }
            using (List <QueueItem> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    MethodInvoker method = null;
                    QueueItem     item   = enumerator.Current;
                    if (item.control != null)
                    {
                        if (method == null)
                        {
                            method = delegate
                            {
                                switch (item.mode)
                                {
                                case AnimateMode.Show:
                                    item.control.Visible = true;
                                    return;

                                case AnimateMode.Hide:
                                    item.control.Visible = false;
                                    return;
                                }
                            };
                        }
                        item.control.BeginInvoke(method);
                    }
                    AnimationCompletedEventArg e = new AnimationCompletedEventArg
                    {
                        Animation = item.animation,
                        Control   = item.control,
                        Mode      = item.mode
                    };
                    this.OnAnimationCompleted(e);
                }
            }
            if (list.Count > 0)
            {
                this.OnAllAnimationsCompleted();
            }
        }
示例#3
0
        private void OnCompleted(QueueItem item)
        {
            if (item.controller != null)
            {
                item.controller.Dispose();
            }
            lock (this.queue)
            {
                this.queue.Remove(item);
            }
            AnimationCompletedEventArg e = new AnimationCompletedEventArg
            {
                Animation = item.animation,
                Control   = item.control,
                Mode      = item.mode
            };

            this.OnAnimationCompleted(e);
        }
示例#4
0
 private void OnCompleted(QueueItem item)
 {
     if (item.controller != null)
     {
         item.controller.Dispose();
     }
     lock (this.queue)
     {
         this.queue.Remove(item);
     }
     AnimationCompletedEventArg e = new AnimationCompletedEventArg
     {
         Animation = item.animation,
         Control = item.control,
         Mode = item.mode
     };
     this.OnAnimationCompleted(e);
 }
示例#5
0
 protected virtual void OnAnimationCompleted(AnimationCompletedEventArg e)
 {
     if (this.AnimationCompleted != null)
     {
         this.AnimationCompleted(this, e);
     }
 }
示例#6
0
        public void ClearQueue()
        {
            List<QueueItem> list = null;
            lock (this.queue)
            {
                list = new List<QueueItem>(this.queue);
                this.queue.Clear();
            }
            using (List<QueueItem>.Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    MethodInvoker method = null;
                    QueueItem item = enumerator.Current;
                    if (item.control != null)
                    {
                        if (method == null)
                        {
                            method = delegate
                            {
                                switch (item.mode)
                                {
                                    case AnimateMode.Show:
                                        item.control.Visible = true;
                                        return;

                                    case AnimateMode.Hide:
                                        item.control.Visible = false;
                                        return;
                                }
                            };
                        }
                        item.control.BeginInvoke(method);
                    }
                    AnimationCompletedEventArg e = new AnimationCompletedEventArg
                    {
                        Animation = item.animation,
                        Control = item.control,
                        Mode = item.mode
                    };
                    this.OnAnimationCompleted(e);
                }
            }
            if (list.Count > 0)
            {
                this.OnAllAnimationsCompleted();
            }
        }