本文整理汇总了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;
}
示例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;
}
}
}
}
}
示例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] = "???";
}
}
}
示例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"));
}
示例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();
}
示例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;
}
示例8: ATimerOnElapsed
private void ATimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
{
if (counter <= this.Ticks)
{
counter++;
this.MethodTobeCalled();
}
}
示例9: timer_Elapsed
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
if (this.countTicks < this.ticks)
{
this.countTicks++;
this.Method();
}
}
示例10: HandleElapsed1
void HandleElapsed1 (object sender, ElapsedEventArgs e)
{
Time--;
if (Time == 0)
{
GameOverStep1();
}
}
示例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;
}
示例12: cjdnsPoller_Elapsed
void cjdnsPoller_Elapsed(object sender, ElapsedEventArgs e)
{
cjdns.Refresh();
if(cjdns.HasExited) {
// Die sadly
Environment.Exit(1);
}
}
示例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;
}
示例14: refreshTimerHandler
private void refreshTimerHandler(object sender, ElapsedEventArgs e)
{
updateHostList = true;
dots += ".";
if (dots.Equals("......"))
{
dots = "";
}
}
示例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;
}
}