当前位置: 首页>>代码示例>>C#>>正文


C# ElapsedEventArgs类代码示例

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


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

示例1: pushWords

    public void pushWords(object sender, ElapsedEventArgs e)
    {
        if (queue == "") {
            queue = getPhrases ();
         }
        //get the last char of the queue, push to the UI
        string lastChar = queue.Substring(queue.Length - 1, 1);
        //Debug.Log ("queue: " + queue + ", lastChar: " + lastChar);

        //if the queue is empty(i.e. queue = "")
        //then get a new phrases and add to the queue
        if (queue.Length == 1) {
            phrasesToPush = " " + lastChar + phrasesToPush;
        } else {
            phrasesToPush = lastChar + phrasesToPush;
        }

        int textChar = phrasesToPush.Length;
        if (textChar > textLimit) {
            phrasesToPush = phrasesToPush.Remove(textLimit-1);
        }

        //remove it from the queue
        queue = queue.Remove (queue.Length - 1);

        /* old method */
        //string phrases_cur = getPhrases();
        //phrasesToPush = phrases_cur + " " + phrasesBefore;
    }
开发者ID:jhave,项目名称:Gallery360,代码行数:29,代码来源:CylinderTextLoop.cs

示例2: CheckStatusForRegistered

 private void CheckStatusForRegistered(Object sender, ElapsedEventArgs e)
 {
     lock (_lock)
     {
         foreach (AsyncRequestState clientState in _clientStateList)
         {
             if (clientState.CurrentContext.Session != null)
             {
                 ImageServiceClientManager manager = (ImageServiceClientManager)clientState.CurrentContext.Session["Manager"];
                 bool? status = manager.Status();
                 if (status.HasValue && status.Value == false)
                 {
                     clientState.CurrentContext.Response.Write(serializer.Serialize(new { isError = false, needToUpdate = true }));
                     clientState.CompleteRequest();
                 }
                 else if (!status.HasValue)
                 {
                     string errorMessage_ = manager.Notifier.GetLastError();
                     clientState.CurrentContext.Response.Write(serializer.Serialize(new { isError = true, errorMessage = errorMessage_ }));
                     clientState.CompleteRequest();
                     _clientStateList.Clear();
                     break;
                 }
             }
         }
     }
 }
开发者ID:duda92,项目名称:ImageService,代码行数:27,代码来源:UpdateClientProcessor.cs

示例3: GetRealDataTimer

 private static void GetRealDataTimer(object source,ElapsedEventArgs e)
 {
     try
     {
         OdbcDataAdapter adapter = new OdbcDataAdapter("select A_CV from FIX", RealConnection);
         DataSet ds = new DataSet();
         adapter.Fill(ds, "FIX");
         
         for (int i = 0; i < 100; i++)
         {
             data[i] = ds.Tables[0].Rows[i]["A_CV"].ToString();
         }
         adapter.Dispose();
         // RealConnection..Close();
         
     }
     catch (Exception ex)
     {
         for (int i = 0; i < 100; i++)
         {
             data[i] = "???";
         }
         
     }
 }
开发者ID:neroanelli,项目名称:DCS.Web,代码行数:25,代码来源:IFixDataTimer.cs

示例4: timerElapsed

 /// <summary>
 /// Laddar om prenumerationer när tiden gått ut.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void timerElapsed(object sender, ElapsedEventArgs e)
 {
     timer.Enabled = false;
     LaddaOmPrenumerationerTimer();
     Console.WriteLine("Det gick bra");
     timer.Enabled = true;
 }
开发者ID:Zaitzewsky,项目名称:Informatik-B--Objektorienterad-programmering-med-C-,代码行数:12,代码来源:TimerInitializer.cs

示例5: OnTimerTick

 // Specify what you want to happen when the Elapsed event is raised. 
 private static void OnTimerTick(object source, ElapsedEventArgs e)
 {
     Console.WriteLine(
         "{0} was called at {1} by the Elapsed event.",
         System.Reflection.MethodBase.GetCurrentMethod().Name,
         e.SignalTime.ToString("HH:mm:ss"));
 }
开发者ID:MarKamenov,项目名称:TelerikAcademy,代码行数:8,代码来源:TimerExample.cs

示例6: DisplayTimeEvent

 //Displays the current time each second
 public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
 {
     //Writes time to console each second
     Console.Write("\r{0}", DateTime.Now.ToString("O"));
     timeTimer.Interval = GetSecondInterval();
     timeTimer.Start();
 }
开发者ID:nlblunt,项目名称:exodus_server,代码行数:8,代码来源:main.cs

示例7: executeTimer

    static void executeTimer(object sender, ElapsedEventArgs elapsedEventArgs)
    {
        IConnectionManager connectionManager = AspNetHost.DependencyResolver.Resolve<IConnectionManager>();
        IConnection connection = connectionManager.GetConnection<MyConnection>();

        connection.Broadcast(counter.ToString());
        counter += 1;
    }
开发者ID:helmus,项目名称:SignalRdemo,代码行数:8,代码来源:SqlDependencyManager.cs

示例8: ATimerOnElapsed

 private void ATimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
 {
     if (counter <= this.Ticks)
     {
        counter++;
        this.MethodTobeCalled();
     }
 }
开发者ID:i-yotov,项目名称:Courses,代码行数:8,代码来源:AsyncTimer.cs

示例9: timer_Elapsed

 void timer_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (this.countTicks < this.ticks)
     {
         this.countTicks++;
         this.Method();
     }
 }
开发者ID:zhanivanov,项目名称:OOP_September_Homeworks,代码行数:8,代码来源:AsyncTimer.cs

示例10: HandleElapsed1

	void HandleElapsed1 (object sender, ElapsedEventArgs e)
	{
		Time--;
		if (Time == 0) 
		{
			GameOverStep1();
		}
	}
开发者ID:joglimartins,项目名称:MotionMagixSDK,代码行数:8,代码来源:Spawner.cs

示例11: ResetScoreVisibility

 /// <summary>
 /// Resets the score label to its default look after the timer is expired.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The arguments belonging to the event</param>
 private void ResetScoreVisibility(object sender, ElapsedEventArgs e)
 {
     if (sender.GetType() == typeof(System.Timers.Timer))
     {
         ((System.Timers.Timer)sender).Dispose();
     }
     StateManager.Instance.NewMoneyPowerup = false;
 }
开发者ID:TiddoLangerak,项目名称:Context-groep-3,代码行数:13,代码来源:PointsPowerupBehaviour.cs

示例12: cjdnsPoller_Elapsed

	void cjdnsPoller_Elapsed(object sender, ElapsedEventArgs e)
	{
		cjdns.Refresh();
		if(cjdns.HasExited) {
			// Die sadly
			Environment.Exit(1);
		}
	}
开发者ID:interfect,项目名称:cjdns-installer,代码行数:8,代码来源:main.cs

示例13: HeartBeatRElapsed

 private void HeartBeatRElapsed(object sender, ElapsedEventArgs e)
 {
     Debug.Log("RBEAT");
     AudioSource.PlayClipAtPoint(HeartBeats[1],player.transform.position);
     heartBeatR.Interval = HeartRate;
     heartBeatR.Enabled = false;
     heartBeatL.Enabled = true;
 }
开发者ID:efranford,项目名称:HeartOfTheMountain,代码行数:8,代码来源:Heartbeat.cs

示例14: refreshTimerHandler

 private void refreshTimerHandler(object sender, ElapsedEventArgs e)
 {
     updateHostList = true;
     dots += ".";
     if (dots.Equals("......"))
     {
         dots = "";
     }
 }
开发者ID:Master2112,项目名称:golemrts,代码行数:9,代码来源:LobbyView.cs

示例15: ShowStackTrace

	static void ShowStackTrace (object o, ElapsedEventArgs e)
	{
		Console.WriteLine (counter);
		Console.WriteLine ("Threads Equal:   {0}", System.Threading.Thread.CurrentThread == startup_thread);
		if (counter++ > 5) {
			t.AutoReset = false;
			t.Enabled = false;
		}
	}
开发者ID:hitswa,项目名称:winforms,代码行数:9,代码来源:swf-timers.cs


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