コード例 #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
ファイル: UIAnimator.cs プロジェクト: weitaoxiao/ClientEngine
 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
ファイル: UIAnimator.cs プロジェクト: weitaoxiao/ClientEngine
 protected virtual void OnAnimationCompleted(AnimationCompletedEventArg e)
 {
     if (this.AnimationCompleted != null)
     {
         this.AnimationCompleted(this, e);
     }
 }
コード例 #6
0
ファイル: UIAnimator.cs プロジェクト: weitaoxiao/ClientEngine
        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();
            }
        }