zoukankan      html  css  js  c++  java
  • Movie类

    /// <summary>
        /// 3D动画类
        /// </summary>
        public class Movie
        {
            Timer _timer = new Timer();

            public Movie()
            {
                _timer.Enabled = false;
                _timer.Tick += new EventHandler(timer_Tick);
            }

            void timer_Tick(object sender, EventArgs e)
            {
                if(Refrash!=null)
                    Refrash();
                //如果有计数
                if (_RunTimes >= 1)
                {
                    _nowCount++;
                    //到达次数
                    if (_nowCount == _RunTimes)
                        IsRunning = false;
                }
            }

            /// <summary>
            /// 运行状态
            /// </summary>
            public bool IsRunning
            {
                get { return _timer.Enabled; }
                set { _timer.Enabled = value; }
            }

            /// <summary>
            /// 刷新的动作
            /// </summary>
            public Action Refrash;

            /// <summary>
            /// 执行刷新动作的间隔时间(毫秒)
            /// </summary>
            public int Interval
            {
                get { return _timer.Interval; }
                set { _timer.Interval = value; }
            }

            int _nowCount=0;

            int _RunTimes = 0;
            /// <summary>
            /// 总共运行次数[为0则不计次数]
            /// </summary>
            public int RunTimes
            {
                get { return _RunTimes; }
                set
                {
                    //重置当运行的次数
                    _nowCount = 0;
                    //关闭运行
                    IsRunning = false;
                    _RunTimes = value;
                }
            }
        }

  • 相关阅读:
    【转】winrar命令行详解
    【转】关于色彩空间sRGB和Adobe RGB...
    深入解读TPC-C指标
    解决因 RsFX devicer 而无法卸载 SQL Server 的问题
    LUHN算法
    信用卡卡号编排的含义
    关于第三方API调用的工具 WebApiClient.JIT 的使用记录
    ocelot.json模板
    C#进阶之事件与委托(Event&Delegate)
    C#进阶之面向对象(OOP)
  • 原文地址:https://www.cnblogs.com/gxlinhai/p/1977191.html
Copyright © 2011-2022 走看看