Пример #1
0
 protected virtual void OnAnimationCompleted(AnimationCompletedEventArg e)
 {
     if (AnimationCompleted != null)
     {
         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())
            {
                MethodInvoker method = null;
                QueueItem     item;
                while (enumerator.MoveNext())
                {
                    item = enumerator.Current;
                    if (item.control != null)
                    {
                        if (method == null)
                        {
                            method = delegate {
                                switch (item.mode)
                                {
                                case AnimateMode.Show:
                                    item.control.Visible = true;
                                    break;

                                case AnimateMode.Hide:
                                    item.control.Visible = false;
                                    break;
                                }
                            };
                        }
                        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
 protected virtual void OnAnimationCompleted(AnimationCompletedEventArg e)
 {
     if (AnimationCompleted != null)
         AnimationCompleted(this, e);
 }