• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TimerCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TimerCallback的典型用法代码示例。如果您正苦于以下问题:C# TimerCallback类的具体用法?C# TimerCallback怎么用?C# TimerCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TimerCallback类属于命名空间,在下文中一共展示了TimerCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: set

 public void set(float interval, int repeat, TimerCallback callback, object param, bool useFrame)
 {
     this.interval = interval;
     this.repeat = repeat;
     this.callback = callback;
     this.param = param;
 }
开发者ID:niuniuzhu,项目名称:FairyGUI-unity,代码行数:7,代码来源:Timers.cs


示例2: Delayed

        /// <summary>
        /// 処理延滞
        /// </summary>
        /// <author>Takanori Shibuya</author>
        public void Delayed()
        {
            this.Dispose();

            TimerCallback timerDelegate = new TimerCallback(CallbackHandle);
            this.timer = new Timer(timerDelegate, null, 0, this.delay);
        }
开发者ID:takanemu,项目名称:CSharpSamples,代码行数:11,代码来源:DelayTimer.cs


示例3: Timer

		public Timer (TimerCallback callback, object state, uint dueTime, uint period)
		{
			// convert all values to long - with a special case for -1 / 0xffffffff
			long d = (dueTime == UInt32.MaxValue) ? Timeout.Infinite : (long) dueTime;
			long p = (period == UInt32.MaxValue) ? Timeout.Infinite : (long) period;
			Init (callback, state, d, p);
		}
开发者ID:ngraziano,项目名称:mono,代码行数:7,代码来源:Timer.cs


示例4: OnceTimer

 /// <summary>
 /// 一度だけ実行されるタイマを設定する
 /// </summary>
 /// <param name="callback">タイマコールバック関数</param>
 /// <param name="startTime">開始する日時</param>
 /// <returns>生成されたタイマインスタンス</returns>
 public static Timer OnceTimer(TimerCallback callback, DateTime startTime)
 {
     TimeSpan ts = startTime - DateTime.Now;
     Trace.WriteLine("[" + DateTime.Now.ToString() + "] LabMonitoring.TimerUtil#OnceTimer\r\n"
         + "New timer is set at " + startTime.ToString() + " at once.");
     return OnceTimer(callback, (int)ts.TotalMilliseconds);
 }
开发者ID:frah,项目名称:labMonitoring,代码行数:13,代码来源:TimerUtil.cs


示例5: TimerWithStartTime

 /// <summary>
 /// 開始日時を指定したタイマを設定する
 /// </summary>
 /// <param name="callback">タイマコールバック関数</param>
 /// <param name="startTime">実行開始日時</param>
 /// <param name="period">繰り返し間隔</param>
 /// <returns>生成されたタイマインスタンス</returns>
 public static Timer TimerWithStartTime(TimerCallback callback, DateTime startTime, TimeSpan period)
 {
     TimeSpan ts = startTime - DateTime.Now;
     Trace.WriteLine("[" + DateTime.Now.ToString() + "] LabMonitoring.TimerUtil#TimerWithStartTime\r\n"
         + "New timer is set at " + startTime.ToString() + " every " + period.Minutes + " minutes.");
     return new Timer(callback, null, ts, period);
 }
开发者ID:frah,项目名称:labMonitoring,代码行数:14,代码来源:TimerUtil.cs


示例6: LoadView

		private void LoadView ()
		{
			// Paste your license key here.
			mNChartView.Chart.LicenseKey = "";

			// Margin to ensure some free space for the iOS status bar.
			mNChartView.Chart.CartesianSystem.Margin = new NChartTypes.Margin (10.0f, 10.0f, 10.0f, 20.0f);

			// Create column series with colors from the array and add them to the chart.
			NChartColumnSeries series = new NChartColumnSeries ();

			// Set brush that will fill that series with color.
			series.Brush = new NChartSolidColorBrush (Color.Argb (255, 100, 200, 225));

			// Set data source for the series.
			series.DataSource = this;

			// Add series to the chart.
			mNChartView.Chart.AddSeries (series);

			// Activate streaming mode.
			mNChartView.Chart.StreamingMode = true;

			// Prevent minimum and maximum on the axes from "jumping" by activating incremental mode. So the minimum will remain
			// the minimal value ever appeared in the data, and maximum will remain the maximal one.
			mNChartView.Chart.IncrementalMinMaxMode = true;

			// Update data in the chart.
			mNChartView.Chart.UpdateData ();

			TimerCallback timerCallback = new TimerCallback (Stream);
			timer = new Timer (timerCallback, mNChartView.Chart.GetSeries () [mNChartView.Chart.GetSeries ().Length - 1], 100, 100);
		}
开发者ID:KiranKumarAlugonda,项目名称:TXTSHD,代码行数:33,代码来源:MainActivity.cs


示例7: Main

        static void Main(string[] args)
        {
            TimerCallback callback = new TimerCallback(RequestService);

            Timer stateTimer = new Timer(callback, null, 0, 3000);
            for (; ; ) { }
        }
开发者ID:kirti-zare,项目名称:EOS,代码行数:7,代码来源:Program.cs


示例8: SmartTimer

 public SmartTimer(TimerCallback callback, object state, TimeSpan due, TimeSpan period)
 {
     this.period = period;
     this.callback = callback;
     this.next = DateTime.UtcNow + due;
     this.timer = new Timer(new TimerCallback(this.HandleCallback), state, due, this.infinite);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:SmartTimer.cs


示例9: RunTimer

        public void RunTimer()
        {
            TimeObject TimeObj = new TimeObject();
            TimeObj.enable = true;
            TimeObj.count = 1;

            TimerCallback TimerDelegate = new TimerCallback(TimerTask);

            Timer TimerItem = new Timer(TimerDelegate, TimeObj, 2000, delay);

            TimeObj.timer = TimerItem;
            TimeSpan span1 = TimeSpan.FromMinutes(this.minutes);

            if (!infi)
            {
                while (TimeObj.count < max_count)
                {
                    Thread.Sleep(span1);
                }
            }
            else
            {
                while (true)
                {
                    Thread.Sleep(span1);
                }
            }

            TimeObj.enable = false;
        }
开发者ID:CarlosX,项目名称:RakionLauncher,代码行数:30,代码来源:TimerX.cs


示例10: TSK_Timer

        public TSK_Timer(UInt64 period, Boolean repeat, TimerCallback callback)
        {
            mPeriod = period;
            mRepeat = repeat;

            mTimer = new Timer(callback, this, Timeout.Infinite, Timeout.Infinite);
        }
开发者ID:DoubangoTelecom,项目名称:xbox-voip,代码行数:7,代码来源:TSK_Timer.cs


示例11: Timer

        public Timer(TimerCallback callback, object state, int dueTime, int period)
        {
            this.callback = callback;
            this.state = state;

            Change(dueTime, period);
        }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:7,代码来源:Timer.cs


示例12: Cymbal

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="percussion">Percussion enumeration</param>
 /// <param name="sound">Cymbal sound</param>
 /// <param name="boundaries">Bounding box</param>
 /// <param name="touchAreas">List of rectangular touch areas</param>
 /// <param name="image">Cymbal image</param>
 public Cymbal(Percussion percussion, SoundEffect sound, Rectangle boundaries, List<Rectangle> touchAreas, Texture2D image)
     : base(percussion, sound, boundaries, touchAreas, image)
 {
     MaxAngle = 0.26f; // Default for max angle (~15 degrees)
     rotate = new TimerCallback(RotateCallback);
     Played += new EventHandler(Cymbal_Played);
 }
开发者ID:nagyist,项目名称:drumkit-wp,代码行数:15,代码来源:Cymbal.cs


示例13: RecurringCall

        public static Timer RecurringCall(double delay, TimerCallback callback)
        {
            Timer newTimer = null;
            Timer returnTimer = null;

            try
            {
                newTimer = new Timer(delay);
                newTimer.AutoReset = true;
                newTimer.Elapsed += new ElapsedEventHandler(delegate(object sender, ElapsedEventArgs args)
                {
                    try
                    {
                        callback();
                    }
                    catch (Exception ex)
                    {
                        Logger.Fatal(Strings.UnhandledExceptionCaught, ex.ToString());
                        Environment.FailFast(Strings.UnhandledExceptionCaught2 + "\r\n" + ex.ToString());
                    }
                });
                newTimer.Enabled = true;
                returnTimer = newTimer;
                newTimer = null;
            }
            finally
            {
                if (newTimer != null)
                {
                    newTimer.Close();
                }
            }

            return returnTimer;
        }
开发者ID:adasescu,项目名称:cf-windows-extensions,代码行数:35,代码来源:TimerHelper.cs


示例14: DefaultKeepAliveTracker

 public DefaultKeepAliveTracker(TimeSpan keepAliveInterval, TimerCallback keepAliveCallback)
 {
     _keepAliveInterval = keepAliveInterval;
     _keepAliveTimerElapsedCallback = keepAliveCallback;
     _lastSendActivity = new Stopwatch();
     _lastReceiveActivity = new Stopwatch();
 }
开发者ID:cube3power,项目名称:Cowboy,代码行数:7,代码来源:KeepAliveTracker.cs


示例15: CTaskManager_WuQi

        private int timer_lock = 0; //定时器循环重复进入锁

        #endregion Fields

        #region Constructors

        private CTaskManager_WuQi()
        {
            l_tasks = new List<CTask_WuQi>();
            task_lock = new object();
            timerDelegate = new TimerCallback(TimerMethod);
            ticker = new Timer(timerDelegate,this,30000,peroid);
        }
开发者ID:Letractively,项目名称:openwebframe,代码行数:13,代码来源:CTaskManager.cs


示例16: initializeTimer

        public void initializeTimer()
        {
            callBack = new TimerCallback(updateCB);

            timer = new System.Threading.Timer(
                callBack, DownloadQueueListBox, 0, 5000);
        }
开发者ID:niranjan-nagaraju,项目名称:SMART-Downloader,代码行数:7,代码来源:Download+Queue.cs


示例17: OnStart

 protected override void OnStart(string[] args)
 {
     //Below code fires once a second
     job = new CronJob();
     timerDelegate = new TimerCallback(job.DoSomething);
     stateTimer = new Timer(timerDelegate, null, 1000, 1000);
 }
开发者ID:tsmithsoftware,项目名称:SoloProjects,代码行数:7,代码来源:CronService.cs


示例18: SetCallback

        public void SetCallback(TimerCallback callback)
        {
            if (_timer != null)
                _timer.Dispose();

            _timer = new Timer(callback);
        }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:7,代码来源:TimerWrapper.cs


示例19: StartSessionRefresh

 public static void StartSessionRefresh()
 {
     if (!IsSaasConnection)
         return;
     callback = new TimerCallback (Refresh);
     timer = new Timer (callback, null, 0, 300000);
 }
开发者ID:QualitySolution,项目名称:QSProjects,代码行数:7,代码来源:Session.cs


示例20: Init

        public void Init()
        {
            BeforeHour = DateTime.Now.Hour;

            TimerCallback Mastertc = new TimerCallback(MasterCounter);
            Mastertimer = new Timer(Mastertc, null, 0, 1000);
        }
开发者ID:FreyYa,项目名称:GranBlueHelper,代码行数:7,代码来源:TimeLord.cs



注:本文中的TimerCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TimerEx类代码示例发布时间:2022-05-24
下一篇:
C# Timer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap